14 #ifndef _HDGNHelper_H__02052008_1505__
15 #define _HDGNHelper_H__02052008_1505__
23 #include "OdaCommon.h"
24 #include "DgDatabase.h"
25 #include "Int32Array.h"
27 #include "Gi/GiWorldGeometry.h"
28 #include "Gi/GiPolyline.h"
29 #include "Gi/GiGeometry.h"
30 #include "Gi/GiCommonDraw.h"
31 #include "Gi/GiWorldDraw.h"
32 #include "Ge/geelliparc2d.h"
33 #include "Ge/geelliparc3d.h"
34 #include "DgModelerGeometry.h"
35 #include "Br/BrBrep.h"
37 #include "ModelerDefs.h"
38 #include "DbObjectId.h"
40 #include "DgLevelMask.h"
42 #include "DgModelerGeometry/DgModelerModule.h"
43 #include "Wr/wrTriangulationParams.h"
45 #include "StaticRxObject.h"
46 #include "DynamicLinker.h"
47 #include "RxDynamicModule.h"
48 #include "DgModelerGeometryCreator.h"
49 #include "ExDgnServices.h"
50 #include "ExDgnHostAppServices.h"
52 #include "Gi/GiDrawable.h"
54 #include "DgLineString.h"
56 #include "DgTextNode.h"
59 #include "DgEllipse.h"
62 #include "DgComplexString.h"
63 #include "DgComplexShape.h"
64 #include "DgPointString.h"
65 #include "DgDimension.h"
66 #include "DgMultiline.h"
67 #include "DgBSplineCurve.h"
68 #include "Dg3DObject.h"
69 #include "DgRasterAttach.h"
71 #include "DgTagElement.h"
72 #include "DgCellHeader.h"
73 #include "DgBSplineSurface.h"
74 #include "DgLevelTableRecord.h"
75 #include "DgFontTableRecord.h"
76 #include "DgTextStyleTableRecord.h"
77 #include "DgDimStyleTableRecord.h"
78 #include "DgMultilineStyleTableRecord.h"
79 #include "DgLineStyleTableRecord.h"
80 #include "DgRegAppTableRecord.h"
82 #include "DgSharedCellDefinition.h"
83 #include "DgSharedCellReference.h"
84 #include "DgTagSetDefinition.h"
85 #include "DgReferenceAttach.h"
87 #include "RxObjectImpl.h"
102 OdUInt16 m_nNestedDepth;
106 VHash<char*,int> *m_vhashOfImmediateChildXref ;
108 VList<TreeNode*> m_ChildNodes;
113 m_pchName =
new char[strlen(pChNode) + 1];
114 strcpy(m_pchName,pChNode);
115 m_ChildNodes.Flush();
117 m_pParentNode = NULL;
120 m_vhashOfImmediateChildXref =
new VHash<char*,int>;
125 m_ChildNodes.Flush();
127 m_vhashOfImmediateChildXref->Flush();
129 H_SAFE_DELETE_ARRAY(m_pchName);
132 void SetNestedDepth(OdUInt16 nNestedDepth){ m_nNestedDepth = nNestedDepth;}
134 OdUInt16 GetNestedDepth(){
return m_nNestedDepth;}
136 char *GetName(){
return m_pchName;}
150 virtual void addRef();
151 virtual void release();
152 virtual long numRefs()
const;
153 virtual void import( OdRxObjectPtr object ) = 0;
161 #define MAX_LEVEL_NAME_LEN 256
170 void setDatabase(OdDgDatabasePtr database){ pDb = database ;};
172 inline void OdGePoint2d_2_HPoint(
const OdGePoint2d* odg_point,
HPoint& h_point)
174 h_point.
x = odg_point->x;
175 h_point.
y = odg_point->y;
179 inline void OdGePoint3d_2_HPoint(
const OdGePoint3d* odg_point,
HPoint& h_point)
181 h_point.
x = odg_point->x;
182 h_point.
y = odg_point->y;
183 h_point.
z = odg_point->z;
186 void setInputHandler(
HInputHandler* hand){ m_inputHandler= hand;};
189 bool importDGNFile(
const char * FileName,
bool isXrefPresent);
190 OdDgModelPtr getActiveModel(OdDgDatabasePtr pDatabase);
192 virtual void import( OdRxObjectPtr object ){;};
194 void iterateElm( OdDgElementIteratorPtr iterator,
bool visibilityProcessing,
bool checkProgress,
int CHeaderid=0);
196 HC_KEY getLevelKey( OdDgGraphicsElementPtr grElm );
198 void setLineStyleAndWt(OdDgGraphicsElementPtr grElm);
200 void importXData (OdResBufPtr pRb);
202 int calculateTotalEntities( OdRxObjectPtr
object );
204 void importCellheaderWithHoleAttr();
205 bool AddGeometryInList(
bool);
207 bool isAttachedXREF(
const char* FileName);
210 bool createTreeOfXrefs(
const char * FileName,
TreeNode *ParentNode =0);
211 void fillTheCurrentXrefNodeValues(
const char* FileName,
TreeNode *ParentNode = 0);
212 bool chkOnlySecondLevelXref(
const char* FileName);
213 bool chkXrefFileLevel(
const char* FileName);
221 static bool m_bDGNImportAllModels;
222 static bool m_bisFromEntity ;
223 static bool m_bIgnoreOffEntities ;
224 static char m_cCurrDir[1024] ;
225 static bool m_bFromCellHeader ;
226 static double m_coneFactor ;
227 static bool m_bDGNRebaselineModel ;
228 static bool m_bNoOffset ;
229 static OdDgDatabasePtr pDb;
230 static bool m_bFromSmartSolid ;
231 static char m_cCellHeaderName[1024];
232 static int m_totalEntities;
234 static VHash<HC_KEY,int> *m_hashGeomCellID ;
235 static double m_dMinX, m_dMinY, m_dMinZ;
236 static OdSmartPtr< XRef > m_obXRef;
237 static VHash<int,HC_KEY> m_hashLevelIDKey;
239 static int m_iCellHeaderId;
240 static bool m_bCellHeaderHoleFlag ;
241 static bool m_bWorldDrawEntityFlag ;
242 static HC_KEY m_hkShellKey;
243 static HC_KEY m_hkSolidSegKey;
244 static HC_KEY m_hkHoleSegKey;
245 static HC_KEY m_hkSegTobeUsed;
247 enum {SINGLE_ENTITY_CELLHEADER, BREAK_CELLHEADER, OPT_CELLHEADER};
248 static int m_iCellHeaderOption ;
252 VStringHash<int> imported_xrefs;
253 void resetStaticVars();
274 m_listOfXRefs.Flush();
275 m_listOfXRefsOfXRefs.Flush();
278 void populateXREFs();
279 VList<char*> m_listOfXRefsOfXRefs;
282 VList<char*> m_listOfXRefs;
283 char* m_cXRefSegName;
284 void import( OdRxObjectPtr object );
285 void fillVlistOfXref(OdDgReferenceAttachmentHeaderPtr element);
290 void import( OdRxObjectPtr object );
297 void import( OdRxObjectPtr object );
303 void import( OdRxObjectPtr object );
309 void import( OdRxObjectPtr object );
315 void import( OdRxObjectPtr object );
321 void import( OdRxObjectPtr object );
327 void import( OdRxObjectPtr object );
333 void import( OdRxObjectPtr object );
340 void import( OdRxObjectPtr object );
345 void import( OdRxObjectPtr object );
351 void import( OdRxObjectPtr object );
357 void import( OdRxObjectPtr object );
363 void import( OdRxObjectPtr object ){};
369 void import( OdRxObjectPtr object ){};
376 void import( OdRxObjectPtr object );
379 void importAsEllipticalArc(OdGeEllipArc2d ellipArc,
double rot_angle,
bool isClosed);
387 void import( OdRxObjectPtr object );
389 void importAsEllipticalArc(OdGeEllipArc3d ellipArc,
bool isClosed);
401 void import( OdRxObjectPtr object );
407 void import( OdRxObjectPtr object );
413 static double m_dDeviationForCone;
414 void import( OdRxObjectPtr object );
425 void import( OdRxObjectPtr object ){};
432 void import( OdRxObjectPtr object );
439 void import( OdRxObjectPtr object ){};
445 void import( OdRxObjectPtr object ){};
452 void import( OdRxObjectPtr object );
459 void import( OdRxObjectPtr object ){};
466 void import( OdRxObjectPtr object ){};
473 void import( OdRxObjectPtr object ){};
479 void import( OdRxObjectPtr object ){};
485 void import( OdRxObjectPtr object ){};
493 void getUniformKnots(
bool isClosed,
int totalKnots,
int order,
float*& hKnots);
498 void import( OdRxObjectPtr object );
503 void import( OdRxObjectPtr object );
510 void import( OdRxObjectPtr object );
517 void import( OdRxObjectPtr object );
525 void import( OdRxObjectPtr object );
533 void import( OdRxObjectPtr object ){};
540 void import( OdRxObjectPtr object ){};
549 void import( OdRxObjectPtr object ){};
557 void import( OdRxObjectPtr object ){};
564 void import( OdRxObjectPtr object ){};
571 void import( OdRxObjectPtr object ){};
579 void import( OdRxObjectPtr object ){};
587 void import( OdRxObjectPtr object ){};
595 void import( OdRxObjectPtr object ){};
604 void import( OdRxObjectPtr object ){};
612 void import( OdRxObjectPtr object ){};
620 void import( OdRxObjectPtr object ){};
627 void import( OdRxObjectPtr object ){};
635 void import( OdRxObjectPtr object ){};
643 void import( OdRxObjectPtr object ){};
652 void import( OdRxObjectPtr object );
658 void import( OdRxObjectPtr object );
664 void import( OdRxObjectPtr object ){};
672 void import( OdRxObjectPtr object ){};
680 void import( OdRxObjectPtr object ){};
687 void import( OdRxObjectPtr object ){};
695 void import( OdRxObjectPtr object ){};
702 void import( OdRxObjectPtr object ){};
710 void import( OdRxObjectPtr object ){};
718 void import( OdRxObjectPtr object ){};
726 void import( OdRxObjectPtr object ){};
734 void import( OdRxObjectPtr object ){};
743 void import( OdRxObjectPtr object ){};
752 void import( OdRxObjectPtr object ){};
761 void import( OdRxObjectPtr object ){};
769 void import( OdRxObjectPtr object ){};
777 void import( OdRxObjectPtr object ){};
784 void import( OdRxObjectPtr object );
790 void import( OdRxObjectPtr object );
796 void import( OdRxObjectPtr object );
801 void import( OdRxObjectPtr object ){};
809 void import( OdRxObjectPtr object );
817 void import( OdRxObjectPtr object );
827 m_iSharedCellRefCounter = 0;
828 m_bSharedCellDefTable =
false;
832 int m_iSharedCellRefCounter;
833 bool m_bSharedCellDefTable;
834 void import( OdRxObjectPtr object );
840 void import( OdRxObjectPtr object ){};
847 void import( OdRxObjectPtr object ){};
854 void import( OdRxObjectPtr object ){};
860 void import( OdRxObjectPtr object ){};
866 void import( OdRxObjectPtr object ){};
873 void import( OdRxObjectPtr object ){};
879 void import( OdRxObjectPtr object );
886 public OdExDgnHostAppServices
888 ODRX_USING_HEAP_OPERATORS(OdExDgnSystemServices);
891 extern OdStaticRxObject< HOdExDgnSystemServices > g_HIO_OdExDgnSystemServices ;
898 virtual void setColor(OdUInt16 color) {}
900 virtual void setTrueColor(
const OdCmEntityColor& cmColor) {}
902 virtual void setLayer(OdDbStub* layerId) {}
904 virtual void setLineType(OdDbStub* linetypeId) {}
906 virtual void setSelectionMarker(OdGsMarker markerId) {}
908 virtual void setFillType(OdGiFillType fillType) {}
910 virtual void setFillPlane(
const OdGeVector3d* = 0) {}
912 virtual void setLineWeight(OdDb::LineWeight lw) {}
914 virtual void setLineTypeScale(
double dScale = 1.0) {}
916 virtual void setLineTypeScaleToFit(
bool ) {};
918 virtual void setThickness(
double dThickness) {}
920 virtual void setPlotStyleName(OdDb::PlotStyleNameType, OdDbStub* = 0) {}
922 virtual void setMaterial(OdDbStub* ) {}
924 virtual void setMapper(
const OdGiMapper * ) {}
926 virtual void setVisualStyle(
const OdDbStub* ) {}
928 virtual OdUInt16 color()
const {
return 0; }
930 virtual OdCmEntityColor trueColor()
const {
return OdCmEntityColor(); }
932 virtual OdDbStub* layer()
const {
return 0; }
934 virtual OdDbStub* lineType()
const {
return 0; }
936 virtual OdGiFillType fillType()
const {
return kOdGiFillAlways; }
938 virtual bool fillPlane(OdGeVector3d& ) {
return false; }
940 virtual OdDb::LineWeight lineWeight()
const {
return OdDb::kLnWtByLwDefault; }
942 virtual double lineTypeScale()
const {
return 0.; }
944 virtual double thickness()
const {
return 0.; }
946 virtual OdDb::PlotStyleNameType plotStyleNameType()
const {
return OdDb::kPlotStyleNameByLayer; }
948 virtual OdDbStub* plotStyleNameId()
const {
return 0; }
950 virtual OdDbStub* material()
const {
return 0; }
952 virtual const OdGiMapper* mapper()
const {
return 0; }
954 virtual OdDbStub* visualStyle()
const {
return 0; }
956 virtual void addLight(
const OdDbStub* lightId){}
965 OdGePoint3dArray pnts;
968 void shell( OdInt32 numVertices,
const OdGePoint3d* vertexList, OdInt32 faceListSize,
const OdInt32* faceList,
const OdGiEdgeData* pEdgeData = 0,
const OdGiFaceData* pFaceData = 0,
const OdGiVertexData* pVertexData = 0)
970 pnts.resize(numVertices);
971 memcpy(pnts.asArrayPtr(), vertexList,
sizeof(OdGePoint3d)*numVertices);
972 faces.resize(faceListSize);
973 memcpy(faces.asArrayPtr(), faceList,
sizeof(OdInt32)*faceListSize);
983 OdArray<shellStore> &m_WireCache;
992 : m_WireCache(pWireCache)
996 virtual void pline(
const OdGiPolyline& pline , OdUInt32 n1 , OdUInt32 n2 );
999 virtual OdGeMatrix3d getModelToWorldTransform()
const
1001 return OdGeMatrix3d();
1003 virtual OdGeMatrix3d getWorldToModelTransform()
const
1005 return OdGeMatrix3d();
1008 virtual void pushModelTransform(
const OdGeVector3d& vNormal){};
1010 virtual void pushModelTransform(
const OdGeMatrix3d& xMat);
1012 virtual void popModelTransform(){};
1017 virtual void circle(
const OdGePoint3d& center,
double radius,
const OdGeVector3d& normal);
1019 virtual void circle(
const OdGePoint3d& p1,
const OdGePoint3d& p2,
const OdGePoint3d& p3);
1021 virtual void circularArc(
const OdGePoint3d& center,
double radius,
1022 const OdGeVector3d& normal,
const OdGeVector3d& startVector,
1023 double sweepAngle,OdGiArcType arcType = kOdGiArcSimple);
1026 virtual void circularArc(
const OdGePoint3d& start,
const OdGePoint3d& point,
1027 const OdGePoint3d& end,OdGiArcType arcType = kOdGiArcSimple);
1030 virtual void polyline(OdInt32 nbPoints,
const OdGePoint3d* pVertexList,
1031 const OdGeVector3d* pNormal = NULL,OdGsMarker lBaseSubEntMarker = -1) ;
1034 virtual void polygon(OdInt32 nbPoints,
const OdGePoint3d* pVertexList);
1037 virtual void mesh(OdInt32 rows,
1039 const OdGePoint3d* pVertexList,
1040 const OdGiEdgeData* pEdgeData = NULL,
1041 const OdGiFaceData* pFaceData = NULL,
1042 const OdGiVertexData* pVertexData = NULL);
1044 virtual void shell(OdInt32 nbVertex,
1045 const OdGePoint3d* pVertexList,
1046 OdInt32 faceListSize,
1047 const OdInt32* pFaceList,
1048 const OdGiEdgeData* pEdgeData,
1049 const OdGiFaceData* pFaceData,
1050 const OdGiVertexData* pVertexData );
1052 virtual void text(
const OdGePoint3d& position,
1053 const OdGeVector3d& normal,
const OdGeVector3d& direction,
1054 double height,
double width,
double oblique,
const OdString& msg);
1056 virtual void text(
const OdGePoint3d& position,
1057 const OdGeVector3d& normal,
const OdGeVector3d& direction,
1058 const OdChar* msg, OdInt32 length,
bool raw,
const OdGiTextStyle* pTextStyle);
1061 void ray(
const OdGePoint3d& first,
const OdGePoint3d& second);
1063 virtual void nurbs(
const OdGeNurbCurve3d& nurbs){};
1065 virtual void xline(
const OdGePoint3d& p1,
const OdGePoint3d& p2);
1067 virtual void ellipArc(
const OdGeEllipArc3d& arc,
1068 const OdGePoint3d* pEndPointsOverrides = 0,
1069 OdGiArcType arcType = kOdGiArcSimple);
1071 virtual void draw(
const OdGiDrawable* pD)
1079 virtual void pushClipBoundary(OdGiClipBoundary* pBoundary){};
1080 virtual void popClipBoundary(){};
1082 virtual void worldLine(
const OdGePoint3d pnts[2]);
1084 virtual const OdGiPathNode* currentGiPath()
const
1091 OdSmartPtr< HDGNImporter > m_pHDGNImporter;
1104 virtual double deviation(
const OdGiDeviationType t,
const OdGePoint3d& p)
const ;
1106 virtual OdGiRegenType regenType()
const {
return kOdGiRenderCommand; }
1107 virtual bool regenAbort()
const {
return false; }
1108 virtual OdGiSubEntityTraits& subEntityTraits()
const {
return (OdGiSubEntityTraits&)m_traits; }
1110 virtual bool isDragging()
const {
return false; }
1111 virtual OdUInt32 numberOfIsolines()
const {
return 4; }
1112 virtual OdGiContext* context()
const {
return pCtx; }
1113 void setContext(OdGiContext* pUserContext) { pCtx = pUserContext; }
1124 OdDbDatabase* m_pDb;
1128 OdDbDatabase* pDb) : m_pDb(pDb)
1131 OdDbBaseDatabase* database()
const
1132 {
return (OdDbBaseDatabase*)m_pDb; }
1134 OdGiDrawablePtr openDrawable(OdDbStub*) {
return (OdGiDrawable*)0; }
1140 ODRX_USING_HEAP_OPERATORS(
OdGiGeometry_<OdStaticRxObject<OdGiWorldGeometry> >);
1145 ,
OdGiGeometry_<OdStaticRxObject<OdGiWorldGeometry> >(pWireCache)
1148 virtual void draw(
const OdGiDrawable* pD)
1150 pD->worldDraw(
this);
1152 virtual OdGiGeometry& rawGeometry()
const
1154 return (OdGiGeometry&)*
this;
1156 virtual OdGiWorldGeometry& geometry()
const
1158 return (OdGiWorldGeometry&)*
this;
1161 virtual void setExtents(
const OdGePoint3d *pNewExtents) { }
1170 Model m_modelimporter;
1173 Solid m_solidimporter;
1175 Cone m_coneimporter;
1184 Arc2d m_arc2dimporter;
1185 Arc3d m_arc3dimporter;
1190 Text2d m_bText2dimporter;
1191 Text3d m_bText3dimporter;
1192 XRef m_bReferenceHeaderimporter;
1196 Mesh m_bMeshimporter;
1198 View m_viewImporter;
1210 #endif //_HDGNHelper_H__02052008_1505__
Definition: HDGNHelper.h:814
Definition: HDGNHelper.h:864
Definition: HDGNHelper.h:319
Definition: HDGNHelper.h:799
Definition: HDGNHelper.h:877
Definition: HDGNHelper.h:601
float z
The z-coordinate of a 3-dimensional point.
Definition: HGlobals.h:131
Definition: HDGNHelper.h:384
Definition: HDGNHelper.h:514
Definition: HDGNHelper.h:530
Definition: HDGNHelper.h:429
Definition: HDGNHelper.h:294
Definition: HDGNHelper.h:979
Definition: HDGNHelper.h:774
Definition: HDGNHelper.h:464
Definition: HDGNHelper.h:788
Definition: HDGNHelper.h:822
Definition: HDGNHelper.h:142
Definition: HDGNHelper.h:766
Definition: HDGNHelper.h:677
Definition: HDGNHelper.h:858
Definition: HDGNHelper.h:793
Definition: HDGNHelper.h:301
Definition: HDGNHelper.h:410
Definition: HDGNHelper.h:349
Definition: HDGNHelper.h:96
Definition: HDGNHelper.h:443
float x
The x-coordinate of a 3-dimensional point.
Definition: HGlobals.h:129
Definition: HDGNHelper.h:1137
Definition: HDGNHelper.h:961
Definition: HDGNHelper.h:501
Definition: HDGNHelper.h:331
Definition: HDGNHelper.h:538
Definition: HDGNHelper.h:405
Definition: HDGNHelper.h:661
Definition: HDGNHelper.h:367
Definition: HDGNHelper.h:632
Definition: HDGNHelper.h:692
Definition: HDGNHelper.h:1165
Definition: HDGNHelper.h:313
Definition: HDGNHelper.h:852
Definition: HDGNHelper.h:592
Definition: HDGNHelper.h:731
Definition: HDGNHelper.h:669
Definition: HDGNHelper.h:640
Definition: HDGNHelper.h:343
Definition: HDGNHelper.h:373
Definition: HDGNHelper.h:1097
Definition: HDGNHelper.h:740
float y
The y-coordinate of a 3-dimensional point.
Definition: HGlobals.h:130
Definition: HDGNHelper.h:546
Definition: HDGNHelper.h:707
The HPoint class is the data type of a three-dimensional point.
Definition: HGlobals.h:126
Definition: HDGNHelper.h:1122
Definition: HDGNHelper.h:685
Definition: HDGNHelper.h:894
Definition: HDGNHelper.h:562
Definition: HDGNHelper.h:554
Definition: HDGNHelper.h:457
Definition: HDGNHelper.h:838
Definition: HDGNHelper.h:423
Definition: HDGNHelper.h:163
Definition: HDGNHelper.h:507
Definition: HDGNHelper.h:477
Definition: HDGNHelper.h:471
Definition: HDGNHelper.h:758
Definition: HDGNHelper.h:288
Definition: HDGNHelper.h:307
Definition: HDGNHelper.h:483
Definition: HDGNHelper.h:885
Definition: HDGNHelper.h:450
Definition: HDGNHelper.h:782
Definition: HDGNHelper.h:845
Definition: HDGNHelper.h:355
Definition: HDGNHelper.h:700
Definition: HDGNHelper.h:437
Definition: HDGNHelper.h:584
A header file containing the HIO classes for passing to HBaseView::FileInput and HBaseView::FileOutpu...
Definition: HDGNHelper.h:568
Definition: HDGNHelper.h:723
Definition: HDGNHelper.h:522
Definition: HDGNHelper.h:716
Definition: HDGNHelper.h:263
Definition: HDGNHelper.h:749
Definition: HDGNHelper.h:496
Definition: HDGNHelper.h:325
Definition: HDGNHelper.h:576
Definition: HDGNHelper.h:871
Definition: HDGNHelper.h:399
Definition: HDGNHelper.h:361
Definition: HDGNHelper.h:806
Definition: HDGNHelper.h:490
Definition: HDGNHelper.h:338