CFx SDK Documentation 2024 SP0
Loading...
Searching...
No Matches
DbEntity.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 _ODDBENTITY_INCLUDED_
25#define _ODDBENTITY_INCLUDED_ /* { Secret} */
26
27#include "TD_PackPush.h"
28
29#include "DbObject.h"
30#include "Ge/GePoint3d.h"
31#include "Ge/GeLine3d.h"
32#include "Ge/GePlane.h"
33#include "CmColor.h"
34#include "IntArray.h"
35#include "DbDatabase.h"
36#include "DbSubentId.h"
37#include "GsMarkerArray.h"
38#include "DbGrip.h"
39#include "OdaDefs.h"
40
41class OdGePlane;
42class OdGeMatrix3d;
44class OdGePoint3d;
45class OdGeVector3d;
47
52
57
62namespace OdDb
63{
64
66 {
71 };
72
74 {
77 kLinear = 2
78 };
79}
80
88{
89public:
91
93
98
103
115 const OdCmColor &color,
116 bool doSubents = true);
117
128
133
149 OdUInt16 colorIndex,
150 bool doSubents = true);
151
156
168 OdDbObjectId colorId,
169 bool doSubents = true);
170
175
189 const OdCmTransparency& transparency,
190 bool doSubents = true);
191
196
203
214 const OdString& plotStyleName,
215 bool doSubents = true);
216
240 OdDb::PlotStyleNameType plotStyleNameType,
241 OdDbObjectId plotStyleNameId = OdDbObjectId::kNull,
242 bool doSubents = true);
243
248
253
264 const OdString& layerName,
265 bool doSubents = true,
266 bool allowHiddenLayer = false);
267
278 OdDbObjectId layerId,
279 bool doSubents = true,
280 bool allowHiddenLayer = false);
281
282
287
292
303 const OdString& linetypeName,
304 bool doSubents = true);
305
316 OdDbObjectId linetypeID,
317 bool doSubents = true);
318
323
328
339 const OdString& materialName,
340 bool doSubents = true);
341
352 OdDbObjectId materialID,
353 bool doSubents = true);
354
355
357 {
360 kEdgeVisualStyle
361 };
362
367 VisualStyleType vstype = kFullVisualStyle) const;
368
381 OdDbObjectId visualStyleId,
382 VisualStyleType vstype = kFullVisualStyle,
383 bool doSubents = true);
384
389 virtual const OdGiMapper* materialMapper() const;
390
401 virtual void setMaterialMapper(
402 const OdGiMapper* mapper,
403 bool doSubents = true);
404
408 double linetypeScale() const;
409
421 double linetypeScale,
422 bool doSubents = true);
423
438
458 OdDb::Visibility visibility,
459 bool doSubents = true) ODRX_SEALED;
460
473 OdDb::Visibility tempVisibility() const;
474
485 void setTempVisibility(OdDb::Visibility visibility);
486
490 OdDb::LineWeight lineWeight() const;
491
502 virtual OdResult setLineWeight(
503 OdDb::LineWeight lineWeight,
504 bool doSubents = true);
505
509 virtual bool castShadows() const;
510
515 virtual void setCastShadows(bool castShadows);
516
520 virtual bool receiveShadows() const;
521
526 virtual void setReceiveShadows(bool receiveShadows);
527
534 virtual OdDb::CollisionType collisionType() const;
535
542 void setPropertiesFrom(
543 const OdDbEntity* pSource,
544 bool doSubents = true);
545
549 virtual bool isPlanar() const;
550
569 virtual OdResult getPlane(
570 OdGePlane& plane,
571 OdDb::Planarity& planarity) const;
572
585 void subHandOverTo(
586 OdDbObject* pNewObject);
587
597 const OdGeMatrix3d& xfm) ODRX_SEALED;
598
609 ODRX_SEALED_VIRTUAL OdResult getTransformedCopy(
610 const OdGeMatrix3d& xfm,
611 OdDbEntityPtr& pCopy) const ODRX_SEALED;
612
628 OdRxObjectPtrArray& entitySet) const ODRX_SEALED;
629
647 virtual OdResult explodeToBlock(
648 OdDbBlockTableRecord *pBlockRecord,
649 OdDbObjectIdArray *ids = 0);
650
665 virtual OdResult explodeGeometry(
666 OdRxObjectPtrArray& entitySet) const;
667
684 virtual OdResult explodeGeometryToBlock(
685 OdDbBlockTableRecord *pBlockRecord,
686 OdDbObjectIdArray *ids = 0);
687
688 virtual bool subWorldDraw(OdGiWorldDraw* pWd) const;
689
690 virtual void subViewportDraw(OdGiViewportDraw* pVd) const;
691
710 void setDatabaseDefaults(
711 OdDbDatabase* pDb = 0,
712 bool doSubents = false);
713
731 virtual void subSetDatabaseDefaults(
732 OdDbDatabase* pDb,
733 bool doSubents);
734
735 virtual void applyPartialUndo(
736 OdDbDwgFiler* pUndoFiler,
737 OdRxClass* pClassObj);
738
739 virtual OdResult dwgInFields(
740 OdDbDwgFiler* pFiler);
741
742 virtual void dwgOutFields(
743 OdDbDwgFiler* pFiler) const;
744
745 void appendToOwner(
746 OdDbIdPair& idPair,
747 OdDbObject* pOwnerObject,
748 OdDbIdMapping& ownerIdMap);
749
750 virtual OdResult dxfIn(
751 OdDbDxfFiler* pFiler);
752
753 virtual void dxfOut(
754 OdDbDxfFiler* pFiler) const;
755
756 virtual OdResult dxfInFields(
757 OdDbDxfFiler* pFiler);
758
759 virtual void dxfOutFields(
760 OdDbDxfFiler* pFiler) const;
761
762 virtual OdResult dxfInFields_R12(
763 OdDbDxfFiler* pFiler);
764
765 virtual void dxfOutFields_R12(
766 OdDbDxfFiler* pFiler) const;
767
768 virtual OdGiDrawable* drawable();
769
770 virtual OdUInt32 subSetAttributes(
771 OdGiDrawableTraits* pTraits) const;
772
773 virtual void subList() const;
774 virtual OdResult subGetClassID(void* pClsid) const;
775
793 void subSwapIdWith(
794 const OdDbObjectId& otherId,
795 bool swapXdata = false,
796 bool swapExtDict = false);
797
798 virtual OdResult subErase( bool erasing) ODRX_OVERRIDE;
799
800 virtual OdResult subOpen(OdDb::OpenMode mode) ODRX_OVERRIDE;
801
811 void recordGraphicsModified(bool graphicsModified = true);
812
813 virtual void copyFrom(const OdRxObject* pSource);
814
815/* No implementation
816 Cause this entity, and any other entity who's draw bit is set, to be be drawn.
817 void draw();
818 */
819
825
826 virtual OdResult getGeomExtents(OdGeExtents3d& extents) const ODRX_SEALED;
827
828 ODRX_SEALED_VIRTUAL void highlight(bool bDoIt = true, const OdDbFullSubentPath* pSubId = 0,
829 bool highlightAll = false) const ODRX_SEALED;
830
864 OdDb::OsnapMode osnapMode,
865 OdGsMarker gsSelectionMark,
866 const OdGePoint3d& pickPoint,
867 const OdGePoint3d& lastPoint,
868 const OdGeMatrix3d& xWorldToEye,
869 OdGePoint3dArray& snapPoints ) const ODRX_SEALED;
870
904 OdDb::OsnapMode osnapMode,
905 OdGsMarker gsSelectionMark,
906 const OdGePoint3d& pickPoint,
907 const OdGePoint3d& lastPoint,
908 const OdGeMatrix3d& xWorldToEye,
909 OdGePoint3dArray& snapPoints,
910 const OdGeMatrix3d& insertionMat) const ODRX_SEALED;
911
912 ODRX_SEALED_VIRTUAL bool isContentSnappable() const ODRX_SEALED;
913
922 ODRX_SEALED_VIRTUAL OdResult getGripPoints( OdGePoint3dArray& gripPoints ) const ODRX_SEALED;
923
935 const OdIntArray& indices,
937
948 const double curViewUnitSize,
949 const int gripSize,
950 const OdGeVector3d& curViewDir,
951 const int bitFlags ) const ODRX_SEALED;
952
960 const OdDbVoidPtrArray& grips,
961 const OdGeVector3d& offset,
962 int bitFlags ) ODRX_SEALED;
963
972 ODRX_SEALED_VIRTUAL OdResult getStretchPoints( OdGePoint3dArray& stretchPoints ) const ODRX_SEALED;
973
985 ODRX_SEALED_VIRTUAL OdResult moveStretchPointsAt(
986 const OdIntArray& indices,
988
994 virtual void dragStatus( const OdDb::DragStat status );
995
1001 ODRX_SEALED_VIRTUAL void gripStatus( const OdDb::GripStat status ) ODRX_SEALED;
1002
1006 ODRX_SEALED_VIRTUAL bool cloneMeForDragging() ODRX_SEALED;
1007
1011 ODRX_SEALED_VIRTUAL bool hideMeForDragging() const ODRX_SEALED;
1012
1023 virtual void saveAs(
1024 OdGiWorldDraw* pWd,
1025 OdDb::DwgVersion ver ) const;
1026
1027
1028
1035 ODRX_SEALED_VIRTUAL OdResult getCompoundObjectTransform(OdGeMatrix3d & xM) const ODRX_SEALED;
1036
1044 OdGePoint3dArray& points, OdGsMarker thisGsMarker = 0,
1045 OdGsMarker otherGsMarker = 0) const ODRX_SEALED;
1046
1054 const OdGePlane& projPlane, OdGePoint3dArray& points,
1055 OdGsMarker thisGsMarker = 0, OdGsMarker otherGsMarker = 0) const ODRX_SEALED;
1056
1060 OdResult boundingBoxIntersectWith(const OdDbEntity* pEnt, OdDb::Intersect intType,
1061 OdGePoint3dArray& points, OdGsMarker thisGsMarker, OdGsMarker otherGsMarker) const;
1062
1066 OdResult boundingBoxIntersectWith(const OdDbEntity* pEnt, OdDb::Intersect intType,
1067 const OdGePlane& projPlane, OdGePoint3dArray& points,
1068 OdGsMarker thisGsMarker, OdGsMarker otherGsMarker) const;
1069
1095 ODRX_SEALED_VIRTUAL OdResult getSubentPathsAtGsMarker(OdDb::SubentType type, OdGsMarker gsMark,
1096 const OdGePoint3d& pickPoint,const OdGeMatrix3d& xfm,
1097 OdDbFullSubentPathArray& subentPaths,
1098 const OdDbObjectIdArray* pEntAndInsertStack = 0) const ODRX_SEALED;
1099
1109 ODRX_SEALED_VIRTUAL OdResult getGsMarkersAtSubentPath( const OdDbFullSubentPath& subPath,
1110 OdGsMarkerArray& gsMarkers) const ODRX_SEALED;
1111
1123 ODRX_SEALED_VIRTUAL OdResult getGripPointsAtSubentPath( const OdDbFullSubentPath& path, OdDbGripDataPtrArray& grips,
1124 const double curViewUnitSize, const int gripSize,
1125 const OdGeVector3d& curViewDir, const OdUInt32 bitflags) const ODRX_SEALED;
1126
1136 ODRX_SEALED_VIRTUAL OdResult moveGripPointsAtSubentPaths( const OdDbFullSubentPathArray& paths,
1137 const OdDbVoidPtrArray& gripAppData, const OdGeVector3d& offset, const OdUInt32 bitflags) ODRX_SEALED;
1138
1146
1154
1162
1170 ODRX_SEALED_VIRTUAL OdResult transformSubentPathsBy(const OdDbFullSubentPathArray &paths, const OdGeMatrix3d & xform) ODRX_SEALED;
1171
1179 ODRX_SEALED_VIRTUAL OdResult getSubentClassId( const OdDbFullSubentPath& path, void* clsId ) ODRX_SEALED;
1180
1188 ODRX_SEALED_VIRTUAL OdResult getSubentPathGeomExtents( const OdDbFullSubentPath& path, OdGeExtents3d& extents ) ODRX_SEALED;
1189
1190 ODRX_SEALED_VIRTUAL void subentGripStatus(OdDb::GripStat status, const OdDbFullSubentPath& subentity) ODRX_SEALED;
1191
1198 virtual OdGeMatrix3d getEcs() const;
1199
1200protected:
1201 virtual OdDbObjectPtr subWblockClone(OdDbIdMapping& ownerIdMap, OdDbObject*, bool bPrimary) const ODRX_OVERRIDE;
1202 virtual OdDbObjectPtr subDeepClone(OdDbIdMapping& ownerIdMap, OdDbObject*, bool bPrimary) const ODRX_OVERRIDE;
1203
1204 virtual OdResult subTransformBy(
1205 const OdGeMatrix3d& xfm);
1206 virtual OdResult subGetTransformedCopy(
1207 const OdGeMatrix3d& xfm,
1208 OdDbEntityPtr& pCopy) const;
1209 virtual OdResult subExplode(
1210 OdRxObjectPtrArray& entitySet) const;
1211 virtual OdResult subGetCompoundObjectTransform(OdGeMatrix3d & xM) const;
1212
1213 virtual bool subCloneMeForDragging();
1214 virtual bool subHideMeForDragging() const;
1215
1216 virtual void subGripStatus( const OdDb::GripStat status );
1217
1218 virtual OdResult subGetOsnapPoints(
1219 OdDb::OsnapMode osnapMode,
1220 OdGsMarker gsSelectionMark,
1221 const OdGePoint3d& pickPoint,
1222 const OdGePoint3d& lastPoint,
1223 const OdGeMatrix3d& xWorldToEye,
1224 OdGePoint3dArray& snapPoints ) const;
1225
1226 virtual OdResult subGetOsnapPoints(
1227 OdDb::OsnapMode osnapMode,
1228 OdGsMarker gsSelectionMark,
1229 const OdGePoint3d& pickPoint,
1230 const OdGePoint3d& lastPoint,
1231 const OdGeMatrix3d& xWorldToEye,
1232 OdGePoint3dArray& snapPoints,
1233 const OdGeMatrix3d& insertionMat) const;
1234
1235 virtual bool subIsContentSnappable() const;
1236
1237 virtual OdResult subGetGripPoints( OdGePoint3dArray& gripPoints ) const;
1238 virtual OdResult subMoveGripPointsAt(const OdIntArray& indices,const OdGeVector3d& offset );
1239 virtual OdResult subGetGripPoints(
1240 OdDbGripDataPtrArray& grips,
1241 const double curViewUnitSize,
1242 const int gripSize,
1243 const OdGeVector3d& curViewDir,
1244 const int bitFlags ) const;
1245 virtual OdResult subMoveGripPointsAt(
1246 const OdDbVoidPtrArray& grips,
1247 const OdGeVector3d& offset,
1248 int bitFlags );
1249 virtual OdResult subGetStretchPoints( OdGePoint3dArray& stretchPoints ) const;
1250 virtual OdResult subMoveStretchPointsAt(
1251 const OdIntArray& indices,
1252 const OdGeVector3d& offset );
1253
1254 virtual OdResult subIntersectWith(const OdDbEntity* pEnt, OdDb::Intersect intType,
1255 OdGePoint3dArray& points, OdGsMarker thisGsMarker = 0,
1256 OdGsMarker otherGsMarker = 0) const;
1257
1258 virtual OdResult subIntersectWith(const OdDbEntity* pEnt, OdDb::Intersect intType,
1259 const OdGePlane& projPlane, OdGePoint3dArray& points,
1260 OdGsMarker thisGsMarker = 0, OdGsMarker otherGsMarker = 0) const;
1261
1262 virtual void subHighlight(bool bDoIt = true, const OdDbFullSubentPath* pSubId = 0,
1263 bool highlightAll = false) const;
1264
1265 virtual OdDb::Visibility subVisibility() const;
1266 virtual OdResult subSetVisibility(OdDb::Visibility visibility, bool doSubents = true);
1267
1268 virtual OdResult subGetGeomExtents(
1269 OdGeExtents3d& extents) const;
1270 virtual OdResult subDeleteSubentPaths(const OdDbFullSubentPathArray& paths);
1271 virtual OdResult subAddSubentPaths(const OdDbFullSubentPathArray& paths);
1272
1273 virtual OdResult subMoveGripPointsAtSubentPaths( const OdDbFullSubentPathArray& paths,
1274 const OdDbVoidPtrArray& gripAppData, const OdGeVector3d& offset, const OdUInt32 bitflags);
1275 virtual OdResult subGetGripPointsAtSubentPath( const OdDbFullSubentPath& path, OdDbGripDataPtrArray& grips,
1276 const double curViewUnitSize, const int gripSize,
1277 const OdGeVector3d& curViewDir, const OdUInt32 bitflags) const;
1278 virtual OdResult subGetSubentPathsAtGsMarker(OdDb::SubentType type, OdGsMarker gsMark,
1279 const OdGePoint3d& pickPoint,const OdGeMatrix3d& xfm,
1280 OdDbFullSubentPathArray& subentPaths,
1281 const OdDbObjectIdArray* pEntAndInsertStack = 0) const;
1282 virtual OdResult subGetGsMarkersAtSubentPath( const OdDbFullSubentPath& subPath,
1283 OdGsMarkerArray& gsMarkers) const;
1284 virtual OdDbEntityPtr subSubentPtr(const OdDbFullSubentPath& path) const;
1285 virtual OdResult subTransformSubentPathsBy(const OdDbFullSubentPathArray &paths, const OdGeMatrix3d & xform);
1286 virtual OdResult subGetSubentClassId( const OdDbFullSubentPath& path, void* clsId ) const;
1287 virtual OdResult subGetSubentPathGeomExtents( const OdDbFullSubentPath& path, OdGeExtents3d& extents ) const;
1288 virtual void subSubentGripStatus(OdDb::GripStat status, const OdDbFullSubentPath& subentity);
1289
1291 friend class OdDbOsnapOverrule;
1293 friend class OdDbGripOverrule;
1298};
1299
1300#include "TD_PackPop.h"
1301
1302#endif /* _ODDBENTITY_INCLUDED_ */
1303
OdArray< OdDbEntityPtr > OdDbEntityPtrArray
Definition: DbEntity.h:56
OdSmartPtr< OdDbEntity > OdDbEntityPtr
Definition: DbEntity.h:51
#define TOOLKIT_EXPORT
Definition: DbExport.h:40
true
Definition: DimVarDefs.h:2046
false
Definition: DimVarDefs.h:165
void intersectWith(TRect &dcRectThis, const TRect &dcRect, bool bValidate=true)
Definition: GsDefs.h:475
ptrdiff_t OdGsMarker
unsigned int OdUInt32
unsigned short OdUInt16
#define ODRX_SEALED_VIRTUAL
#define ODRX_OVERRIDE
#define ODRX_SEALED
OdResult
Definition: OdResult.h:29
virtual OdResult setPlotStyleName(OdDb::PlotStyleNameType plotStyleNameType, OdDbObjectId plotStyleNameId=OdDbObjectId::kNull, bool doSubents=true)
OdDbObjectId materialId() const
virtual OdResult setLinetype(OdDbObjectId linetypeID, bool doSubents=true)
virtual OdResult setColorIndex(OdUInt16 colorIndex, bool doSubents=true)
OdDb::Visibility visibility() const
ODRX_SEALED_VIRTUAL OdResult setVisibility(OdDb::Visibility visibility, bool doSubents=true) ODRX_SEALED
virtual OdResult setLayer(OdDbObjectId layerId, bool doSubents=true, bool allowHiddenLayer=false)
OdDbObjectId visualStyleId(VisualStyleType vstype=kFullVisualStyle) const
virtual OdCmEntityColor entityColor() const
virtual void setMaterialMapper(const OdGiMapper *mapper, bool doSubents=true)
virtual OdResult setLinetypeScale(double linetypeScale, bool doSubents=true)
OdString material() const
virtual OdResult setTransparency(const OdCmTransparency &transparency, bool doSubents=true)
OdDbObjectId blockId() const
OdDbObjectId linetypeId() const
virtual OdResult setMaterial(OdDbObjectId materialID, bool doSubents=true)
virtual OdResult setColor(const OdCmColor &color, bool doSubents=true)
virtual OdResult setPlotStyleName(const OdString &plotStyleName, bool doSubents=true)
virtual OdResult setVisualStyle(OdDbObjectId visualStyleId, VisualStyleType vstype=kFullVisualStyle, bool doSubents=true)
@ kFaceVisualStyle
Definition: DbEntity.h:359
@ kFullVisualStyle
Definition: DbEntity.h:358
virtual OdResult setLayer(const OdString &layerName, bool doSubents=true, bool allowHiddenLayer=false)
virtual OdResult setLinetype(const OdString &linetypeName, bool doSubents=true)
OdDbObjectId layerId() const
ODDB_DECLARE_MEMBERS(OdDbEntity)
OdDbObjectId colorId() const
double linetypeScale() const
OdCmColor color() const
OdString linetype() const
OdDb::PlotStyleNameType getPlotStyleNameId(OdDbObjectId &plotStyleNameId) const
OdUInt16 colorIndex() const
OdString layer() const
virtual OdResult setColorId(OdDbObjectId colorId, bool doSubents=true)
OdCmTransparency transparency() const
OdString plotStyleName() const
virtual OdResult setMaterial(const OdString &materialName, bool doSubents=true)
virtual const OdGiMapper * materialMapper() const
static TOOLKIT_EXPORT_STATIC const OdDbObjectId kNull
Definition: DbObjectId.h:110
GLuint GLsizei GLsizei GLint GLenum * type
Definition: gles2_ext.h:274
GLintptr offset
Definition: gles2_ext.h:183
PlotStyleNameType
Definition: OdaDefs.h:417
EntSaveAsType
Definition: DbEntity.h:66
@ kSaveAsR12
Definition: DbEntity.h:68
@ kNoSave
Definition: DbEntity.h:67
@ kSaveAsR14
Definition: DbEntity.h:70
@ kSaveAsR13
Definition: DbEntity.h:69
Planarity
Definition: DbEntity.h:74
@ kLinear
Definition: DbEntity.h:77
@ kPlanar
Definition: DbEntity.h:76
@ kNonPlanar
Definition: DbEntity.h:75
Visibility
Definition: DbObject.h:146