CFx SDK Documentation 2024 SP0
Loading...
Searching...
No Matches
FMMdlEntity.h
Go to the documentation of this file.
1
2// Copyright (C) 2002-2022, Open Design Alliance (the "Alliance").
3// All rights reserved.
4//
5// This software and its documentation and related materials are owned by
6// the Alliance. The software may only be incorporated into application
7// programs owned by members of the Alliance, subject to a signed
8// Membership Agreement and Supplemental Software License Agreement with the
9// Alliance. The structure and organization of this software are the valuable
10// trade secrets of the Alliance and its suppliers. The software is also
11// protected by copyright law and international treaty provisions. Application
12// programs incorporating this software must include the following statement
13// with their copyright notices:
14//
15// This application incorporates Open Design Alliance software pursuant to a license
16// agreement with Open Design Alliance.
17// Open Design Alliance Copyright (C) 2002-2022 by Open Design Alliance.
18// All rights reserved.
19//
20// By use of this software, its documentation or related materials, you
21// acknowledge and accept the above terms.
23
24#ifndef __FMMDL_ENTITY_H__
25#define __FMMDL_ENTITY_H__
26
27#include "Modeler/FMMdlBase.h"
28
29namespace FacetModeler
30{
31
38 OdUInt32 inline FLAG(OdUInt32 i) { return ((OdUInt32)1 << i); }
39
44 {
45 public:
49 Entity();
50
56 Entity(const Entity& ent);
57
64 Entity& operator =(const Entity& entity);
65
71 OdUInt32 flags() const;
72
78 void setFlags(OdUInt32 iFlags);
79
86 bool isFlagOn(OdUInt32 iFlag) const;
87
94 void setIsFlagOn(OdUInt32 iFlag, bool bOn);
95
101 TagType tag() const;
102
108 void setTag(TagType nTag);
109
113 virtual ~Entity();
114
115 private:
116 OdUInt32 m_flags; // Flags bit fields.
117 TagType m_nTag; // Tag data.
118 };
119
120
121 inline Entity::Entity() {
122 m_flags = 0;
123 m_nTag = 0;
124 }
125
126 inline Entity::Entity(const Entity& ent) {
127 m_nTag = ent.m_nTag;
128 m_flags = ent.m_flags;
129 *this = ent;
130 }
131
132 inline Entity& Entity::operator =(const Entity& ent) {
133 setTag(ent.tag());
134 m_flags = ent.m_flags;
135 return *this;
136 }
137
139 }
140
141 inline OdUInt32 Entity::flags() const {
142 return m_flags;
143 }
144
145 inline void Entity::setFlags(OdUInt32 iFlags) {
146 m_flags = iFlags;
147 }
148
149 inline bool Entity::isFlagOn(OdUInt32 iFlag) const {
150 return GETBIT(m_flags, iFlag);
151 }
152
153 inline void Entity::setIsFlagOn(OdUInt32 iFlag, bool bOn) {
154 SETBIT(m_flags, iFlag, bOn);
155 }
156
157 inline TagType Entity::tag() const {
158 return m_nTag;
159 }
160
161 inline void Entity::setTag(TagType nTag) {
162 m_nTag = nTag;
163 }
164
165}
166
167#endif //__FMMDL_ENTITY_H__
#define FMGEOMETRY_API
unsigned int OdUInt32
#define SETBIT(flags, bit, value)
Definition: OdaDefs.h:516
#define GETBIT(flags, bit)
Definition: OdaDefs.h:517
OdUInt32 flags() const
Definition: FMMdlEntity.h:141
bool isFlagOn(OdUInt32 iFlag) const
Definition: FMMdlEntity.h:149
void setIsFlagOn(OdUInt32 iFlag, bool bOn)
Definition: FMMdlEntity.h:153
TagType tag() const
Definition: FMMdlEntity.h:157
void setTag(TagType nTag)
Definition: FMMdlEntity.h:161
Entity & operator=(const Entity &entity)
Definition: FMMdlEntity.h:132
void setFlags(OdUInt32 iFlags)
Definition: FMMdlEntity.h:145
OdUInt32 FLAG(OdUInt32 i)
Definition: FMMdlEntity.h:38
ptrdiff_t TagType
Definition: FMMdlBase.h:46