CFx SDK Documentation  2023 SP0
FMMdlEntity.h
Go to the documentation of this file.
1 // Copyright (C) 2002-2015, 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 Teigha(R) software pursuant to a license
16 // agreement with Open Design Alliance.
17 // Teigha(R) Copyright (C) 2002-2015 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 
32 namespace FacetModeler
33 {
34 
35 OdUInt32 inline FLAG( OdUInt32 i ) { return (1 << i); }
36 
40 class FMGEOMETRY_API Entity
41 {
42 public:
46  Entity();
47 
50  Entity(const Entity& ent);
51 
54  Entity& operator =(const Entity&);
55 
59  virtual ~Entity();
60 
64  OdUInt32 flags() const;
65 
69  void setFlags( OdUInt32 iFlags );
70 
74  bool isFlagOn( OdUInt32 iFlag ) const;
75 
79  void setIsFlagOn( OdUInt32 iFlag, bool bOn );
80 
84  FacetModeler::AecTagType tag() const;
85 
89  void setTag( FacetModeler::AecTagType nTag );
90 
91 private:
92  OdUInt32 m_flags;
93  AecTagType m_nTag;
94 };
95 
96 
97 inline Entity::Entity() {
98  m_flags = 0;
99  m_nTag = 0;
100 }
101 
102 inline Entity::Entity(const Entity& ent) {
103  m_nTag = ent.m_nTag;
104  *this = ent;
105 }
106 
107 inline Entity& Entity::operator =(const Entity& ent) {
108  setTag( ent.tag() );
109  m_flags = ent.m_flags;
110  return *this;
111 }
112 
113 inline Entity::~Entity() {
114 }
115 
116 inline OdUInt32 Entity::flags() const {
117  return m_flags;
118 }
119 
120 inline void Entity::setFlags( OdUInt32 iFlags ) {
121  m_flags = iFlags;
122 }
123 
124 inline bool Entity::isFlagOn( OdUInt32 iFlag ) const {
125  return GETBIT( m_flags, iFlag );
126 }
127 
128 inline void Entity::setIsFlagOn( OdUInt32 iFlag, bool bOn ) {
129  SETBIT( m_flags, iFlag, bOn );
130 }
131 
132 inline AecTagType Entity::tag() const {
133  return m_nTag;
134 }
135 
136 inline void Entity::setTag( AecTagType nTag ) {
137  m_nTag = nTag;
138 }
139 
140 }
141 
142 #endif //__FMMDL_ENTITY_H__
unsigned int OdUInt32
#define SETBIT(flags, bit, value)
Definition: OdaDefs.h:499
#define GETBIT(flags, bit)
Definition: OdaDefs.h:500
OdUInt32 flags() const
Definition: FMMdlEntity.h:116
void setTag(FacetModeler::AecTagType nTag)
Definition: FMMdlEntity.h:136
FacetModeler::AecTagType tag() const
Definition: FMMdlEntity.h:132
bool isFlagOn(OdUInt32 iFlag) const
Definition: FMMdlEntity.h:124
void setIsFlagOn(OdUInt32 iFlag, bool bOn)
Definition: FMMdlEntity.h:128
Entity & operator=(const Entity &)
Definition: FMMdlEntity.h:107
void setFlags(OdUInt32 iFlags)
Definition: FMMdlEntity.h:120
OdUInt32 FLAG(OdUInt32 i)
Definition: FMMdlEntity.h:35
ptrdiff_t AecTagType
Definition: FMMdlBase.h:42