10 #ifndef _HDGNHelper_H__02052008_1505__
11 #define _HDGNHelper_H__02052008_1505__
19 #include "OdaCommon.h"
20 #include "DgDatabase.h"
21 #include "Int32Array.h"
23 #include "Gi/GiWorldGeometry.h"
24 #include "Gi/GiPolyline.h"
25 #include "Gi/GiGeometry.h"
26 #include "Gi/GiCommonDraw.h"
27 #include "Gi/GiWorldDraw.h"
28 #include "Ge/geelliparc2d.h"
29 #include "Ge/geelliparc3d.h"
30 #include "DgModelerGeometry.h"
31 #include "Br/BrBrep.h"
33 #include "ModelerDefs.h"
34 #include "DbObjectId.h"
36 #include "DgLevelMask.h"
38 #include "DgModelerGeometry/DgModelerModule.h"
39 #include "Wr/wrTriangulationParams.h"
41 #include "StaticRxObject.h"
42 #include "DynamicLinker.h"
43 #include "RxDynamicModule.h"
44 #include "DgModelerGeometryCreator.h"
45 #include "ExDgnServices.h"
46 #include "ExDgnHostAppServices.h"
48 #include "Gi/GiDrawable.h"
50 #include "DgLineString.h"
52 #include "DgTextNode.h"
55 #include "DgEllipse.h"
58 #include "DgComplexString.h"
59 #include "DgComplexShape.h"
60 #include "DgPointString.h"
61 #include "DgDimension.h"
62 #include "DgMultiline.h"
63 #include "DgBSplineCurve.h"
64 #include "Dg3DObject.h"
65 #include "DgRasterAttach.h"
67 #include "DgTagElement.h"
68 #include "DgCellHeader.h"
69 #include "DgBSplineSurface.h"
70 #include "DgLevelTableRecord.h"
71 #include "DgFontTableRecord.h"
72 #include "DgTextStyleTableRecord.h"
73 #include "DgDimStyleTableRecord.h"
74 #include "DgMultilineStyleTableRecord.h"
75 #include "DgLineStyleTableRecord.h"
76 #include "DgRegAppTableRecord.h"
78 #include "DgSharedCellDefinition.h"
79 #include "DgSharedCellReference.h"
80 #include "DgTagSetDefinition.h"
81 #include "DgReferenceAttach.h"
83 #include "RxObjectImpl.h"
98 OdUInt16 m_nNestedDepth;
102 VHash<char*,int> *m_vhashOfImmediateChildXref ;
104 VList<TreeNode*> m_ChildNodes;
109 m_pchName =
new char[strlen(pChNode) + 1];
110 strcpy(m_pchName,pChNode);
111 m_ChildNodes.Flush();
113 m_pParentNode = NULL;
116 m_vhashOfImmediateChildXref =
new VHash<char*,int>;
121 m_ChildNodes.Flush();
123 m_vhashOfImmediateChildXref->Flush();
125 H_SAFE_DELETE_ARRAY(m_pchName);
128 void SetNestedDepth(OdUInt16 nNestedDepth){ m_nNestedDepth = nNestedDepth;}
130 OdUInt16 GetNestedDepth(){
return m_nNestedDepth;}
132 char *GetName(){
return m_pchName;}
146 virtual void addRef();
147 virtual void release();
148 virtual long numRefs()
const;
149 virtual void import( OdRxObjectPtr object ) = 0;
157 #define MAX_LEVEL_NAME_LEN 256
166 void setDatabase(OdDgDatabasePtr database){ pDb = database ;};
168 inline void OdGePoint2d_2_HPoint(
const OdGePoint2d* odg_point,
HPoint& h_point)
170 h_point.
x = odg_point->x;
171 h_point.
y = odg_point->y;
175 inline void OdGePoint3d_2_HPoint(
const OdGePoint3d* odg_point,
HPoint& h_point)
177 h_point.
x = odg_point->x;
178 h_point.
y = odg_point->y;
179 h_point.
z = odg_point->z;
182 void setInputHandler(
HInputHandler* hand){ m_inputHandler= hand;};
185 bool importDGNFile(
const char * FileName,
bool isXrefPresent);
186 OdDgModelPtr getActiveModel(OdDgDatabasePtr pDatabase);
188 virtual void import( OdRxObjectPtr object ){;};
190 void iterateElm( OdDgElementIteratorPtr iterator,
bool visibilityProcessing,
bool checkProgress,
int CHeaderid=0);
192 HC_KEY getLevelKey( OdDgGraphicsElementPtr grElm );
194 void setLineStyleAndWt(OdDgGraphicsElementPtr grElm);
196 void importXData (OdResBufPtr pRb);
198 int calculateTotalEntities( OdRxObjectPtr
object );
200 void importCellheaderWithHoleAttr();
201 bool AddGeometryInList(
bool);
203 bool isAttachedXREF(
const char* FileName);
206 bool createTreeOfXrefs(
const char * FileName,
TreeNode *ParentNode =0);
207 void fillTheCurrentXrefNodeValues(
const char* FileName,
TreeNode *ParentNode = 0);
208 bool chkOnlySecondLevelXref(
const char* FileName);
209 bool chkXrefFileLevel(
const char* FileName);
217 static bool m_bDGNImportAllModels;
218 static bool m_bisFromEntity ;
219 static bool m_bIgnoreOffEntities ;
220 static char m_cCurrDir[1024] ;
221 static bool m_bFromCellHeader ;
222 static double m_coneFactor ;
223 static bool m_bDGNRebaselineModel ;
224 static bool m_bNoOffset ;
225 static OdDgDatabasePtr pDb;
226 static bool m_bFromSmartSolid ;
227 static char m_cCellHeaderName[1024];
228 static int m_totalEntities;
230 static VHash<HC_KEY,int> *m_hashGeomCellID ;
231 static double m_dMinX, m_dMinY, m_dMinZ;
232 static OdSmartPtr< XRef > m_obXRef;
233 static VHash<int,HC_KEY> m_hashLevelIDKey;
235 static int m_iCellHeaderId;
236 static bool m_bCellHeaderHoleFlag ;
237 static bool m_bWorldDrawEntityFlag ;
238 static HC_KEY m_hkShellKey;
239 static HC_KEY m_hkSolidSegKey;
240 static HC_KEY m_hkHoleSegKey;
241 static HC_KEY m_hkSegTobeUsed;
243 enum {SINGLE_ENTITY_CELLHEADER, BREAK_CELLHEADER, OPT_CELLHEADER};
244 static int m_iCellHeaderOption ;
248 VStringHash<int> imported_xrefs;
249 void resetStaticVars();
270 m_listOfXRefs.Flush();
271 m_listOfXRefsOfXRefs.Flush();
274 void populateXREFs();
275 VList<char*> m_listOfXRefsOfXRefs;
278 VList<char*> m_listOfXRefs;
279 char* m_cXRefSegName;
280 void import( OdRxObjectPtr object );
281 void fillVlistOfXref(OdDgReferenceAttachmentHeaderPtr element);
286 void import( OdRxObjectPtr object );
293 void import( OdRxObjectPtr object );
299 void import( OdRxObjectPtr object );
305 void import( OdRxObjectPtr object );
311 void import( OdRxObjectPtr object );
317 void import( OdRxObjectPtr object );
323 void import( OdRxObjectPtr object );
329 void import( OdRxObjectPtr object );
336 void import( OdRxObjectPtr object );
341 void import( OdRxObjectPtr object );
347 void import( OdRxObjectPtr object );
353 void import( OdRxObjectPtr object );
359 void import( OdRxObjectPtr object ){};
365 void import( OdRxObjectPtr object ){};
372 void import( OdRxObjectPtr object );
375 void importAsEllipticalArc(OdGeEllipArc2d ellipArc,
double rot_angle,
bool isClosed);
383 void import( OdRxObjectPtr object );
385 void importAsEllipticalArc(OdGeEllipArc3d ellipArc,
bool isClosed);
397 void import( OdRxObjectPtr object );
403 void import( OdRxObjectPtr object );
409 static double m_dDeviationForCone;
410 void import( OdRxObjectPtr object );
421 void import( OdRxObjectPtr object ){};
428 void import( OdRxObjectPtr object );
435 void import( OdRxObjectPtr object ){};
441 void import( OdRxObjectPtr object ){};
448 void import( OdRxObjectPtr object );
455 void import( OdRxObjectPtr object ){};
462 void import( OdRxObjectPtr object ){};
469 void import( OdRxObjectPtr object ){};
475 void import( OdRxObjectPtr object ){};
481 void import( OdRxObjectPtr object ){};
489 void getUniformKnots(
bool isClosed,
int totalKnots,
int order,
float*& hKnots);
494 void import( OdRxObjectPtr object );
499 void import( OdRxObjectPtr object );
506 void import( OdRxObjectPtr object );
513 void import( OdRxObjectPtr object );
521 void import( OdRxObjectPtr object );
529 void import( OdRxObjectPtr object ){};
536 void import( OdRxObjectPtr object ){};
545 void import( OdRxObjectPtr object ){};
553 void import( OdRxObjectPtr object ){};
560 void import( OdRxObjectPtr object ){};
567 void import( OdRxObjectPtr object ){};
575 void import( OdRxObjectPtr object ){};
583 void import( OdRxObjectPtr object ){};
591 void import( OdRxObjectPtr object ){};
600 void import( OdRxObjectPtr object ){};
608 void import( OdRxObjectPtr object ){};
616 void import( OdRxObjectPtr object ){};
623 void import( OdRxObjectPtr object ){};
631 void import( OdRxObjectPtr object ){};
639 void import( OdRxObjectPtr object ){};
648 void import( OdRxObjectPtr object );
654 void import( OdRxObjectPtr object );
660 void import( OdRxObjectPtr object ){};
668 void import( OdRxObjectPtr object ){};
676 void import( OdRxObjectPtr object ){};
683 void import( OdRxObjectPtr object ){};
691 void import( OdRxObjectPtr object ){};
698 void import( OdRxObjectPtr object ){};
706 void import( OdRxObjectPtr object ){};
714 void import( OdRxObjectPtr object ){};
722 void import( OdRxObjectPtr object ){};
730 void import( OdRxObjectPtr object ){};
739 void import( OdRxObjectPtr object ){};
748 void import( OdRxObjectPtr object ){};
757 void import( OdRxObjectPtr object ){};
765 void import( OdRxObjectPtr object ){};
773 void import( OdRxObjectPtr object ){};
780 void import( OdRxObjectPtr object );
786 void import( OdRxObjectPtr object );
792 void import( OdRxObjectPtr object );
797 void import( OdRxObjectPtr object ){};
805 void import( OdRxObjectPtr object );
813 void import( OdRxObjectPtr object );
823 m_iSharedCellRefCounter = 0;
824 m_bSharedCellDefTable =
false;
828 int m_iSharedCellRefCounter;
829 bool m_bSharedCellDefTable;
830 void import( OdRxObjectPtr object );
836 void import( OdRxObjectPtr object ){};
843 void import( OdRxObjectPtr object ){};
850 void import( OdRxObjectPtr object ){};
856 void import( OdRxObjectPtr object ){};
862 void import( OdRxObjectPtr object ){};
869 void import( OdRxObjectPtr object ){};
875 void import( OdRxObjectPtr object );
882 public OdExDgnHostAppServices
884 ODRX_USING_HEAP_OPERATORS(OdExDgnSystemServices);
887 extern OdStaticRxObject< HOdExDgnSystemServices > g_HIO_OdExDgnSystemServices ;
894 virtual void setColor(OdUInt16 color) {}
896 virtual void setTrueColor(
const OdCmEntityColor& cmColor) {}
898 virtual void setLayer(OdDbStub* layerId) {}
900 virtual void setLineType(OdDbStub* linetypeId) {}
902 virtual void setSelectionMarker(OdGsMarker markerId) {}
904 virtual void setFillType(OdGiFillType fillType) {}
906 virtual void setFillPlane(
const OdGeVector3d* = 0) {}
908 virtual void setLineWeight(OdDb::LineWeight lw) {}
910 virtual void setLineTypeScale(
double dScale = 1.0) {}
912 virtual void setLineTypeScaleToFit(
bool ) {};
914 virtual void setThickness(
double dThickness) {}
916 virtual void setPlotStyleName(OdDb::PlotStyleNameType, OdDbStub* = 0) {}
918 virtual void setMaterial(OdDbStub* ) {}
920 virtual void setMapper(
const OdGiMapper * ) {}
922 virtual void setVisualStyle(
const OdDbStub* ) {}
924 virtual OdUInt16 color()
const {
return 0; }
926 virtual OdCmEntityColor trueColor()
const {
return OdCmEntityColor(); }
928 virtual OdDbStub* layer()
const {
return 0; }
930 virtual OdDbStub* lineType()
const {
return 0; }
932 virtual OdGiFillType fillType()
const {
return kOdGiFillAlways; }
934 virtual bool fillPlane(OdGeVector3d& ) {
return false; }
936 virtual OdDb::LineWeight lineWeight()
const {
return OdDb::kLnWtByLwDefault; }
938 virtual double lineTypeScale()
const {
return 0.; }
940 virtual double thickness()
const {
return 0.; }
942 virtual OdDb::PlotStyleNameType plotStyleNameType()
const {
return OdDb::kPlotStyleNameByLayer; }
944 virtual OdDbStub* plotStyleNameId()
const {
return 0; }
946 virtual OdDbStub* material()
const {
return 0; }
948 virtual const OdGiMapper* mapper()
const {
return 0; }
950 virtual OdDbStub* visualStyle()
const {
return 0; }
952 virtual void addLight(
const OdDbStub* lightId){}
961 OdGePoint3dArray pnts;
964 void shell( OdInt32 numVertices,
const OdGePoint3d* vertexList, OdInt32 faceListSize,
const OdInt32* faceList,
const OdGiEdgeData* pEdgeData = 0,
const OdGiFaceData* pFaceData = 0,
const OdGiVertexData* pVertexData = 0)
966 pnts.resize(numVertices);
967 memcpy(pnts.asArrayPtr(), vertexList,
sizeof(OdGePoint3d)*numVertices);
968 faces.resize(faceListSize);
969 memcpy(faces.asArrayPtr(), faceList,
sizeof(OdInt32)*faceListSize);
979 OdArray<shellStore> &m_WireCache;
988 : m_WireCache(pWireCache)
992 virtual void pline(
const OdGiPolyline& pline , OdUInt32 n1 , OdUInt32 n2 );
995 virtual OdGeMatrix3d getModelToWorldTransform()
const
997 return OdGeMatrix3d();
999 virtual OdGeMatrix3d getWorldToModelTransform()
const
1001 return OdGeMatrix3d();
1004 virtual void pushModelTransform(
const OdGeVector3d& vNormal){};
1006 virtual void pushModelTransform(
const OdGeMatrix3d& xMat);
1008 virtual void popModelTransform(){};
1013 virtual void circle(
const OdGePoint3d& center,
double radius,
const OdGeVector3d& normal);
1015 virtual void circle(
const OdGePoint3d& p1,
const OdGePoint3d& p2,
const OdGePoint3d& p3);
1017 virtual void circularArc(
const OdGePoint3d& center,
double radius,
1018 const OdGeVector3d& normal,
const OdGeVector3d& startVector,
1019 double sweepAngle,OdGiArcType arcType = kOdGiArcSimple);
1022 virtual void circularArc(
const OdGePoint3d& start,
const OdGePoint3d& point,
1023 const OdGePoint3d& end,OdGiArcType arcType = kOdGiArcSimple);
1026 virtual void polyline(OdInt32 nbPoints,
const OdGePoint3d* pVertexList,
1027 const OdGeVector3d* pNormal = NULL,OdGsMarker lBaseSubEntMarker = -1) ;
1030 virtual void polygon(OdInt32 nbPoints,
const OdGePoint3d* pVertexList);
1033 virtual void mesh(OdInt32 rows,
1035 const OdGePoint3d* pVertexList,
1036 const OdGiEdgeData* pEdgeData = NULL,
1037 const OdGiFaceData* pFaceData = NULL,
1038 const OdGiVertexData* pVertexData = NULL);
1040 virtual void shell(OdInt32 nbVertex,
1041 const OdGePoint3d* pVertexList,
1042 OdInt32 faceListSize,
1043 const OdInt32* pFaceList,
1044 const OdGiEdgeData* pEdgeData,
1045 const OdGiFaceData* pFaceData,
1046 const OdGiVertexData* pVertexData );
1048 virtual void text(
const OdGePoint3d& position,
1049 const OdGeVector3d& normal,
const OdGeVector3d& direction,
1050 double height,
double width,
double oblique,
const OdString& msg);
1052 virtual void text(
const OdGePoint3d& position,
1053 const OdGeVector3d& normal,
const OdGeVector3d& direction,
1054 const OdChar* msg, OdInt32 length,
bool raw,
const OdGiTextStyle* pTextStyle);
1057 void ray(
const OdGePoint3d& first,
const OdGePoint3d& second);
1059 virtual void nurbs(
const OdGeNurbCurve3d& nurbs){};
1061 virtual void xline(
const OdGePoint3d& p1,
const OdGePoint3d& p2);
1063 virtual void ellipArc(
const OdGeEllipArc3d& arc,
1064 const OdGePoint3d* pEndPointsOverrides = 0,
1065 OdGiArcType arcType = kOdGiArcSimple);
1067 virtual void draw(
const OdGiDrawable* pD)
1075 virtual void pushClipBoundary(OdGiClipBoundary* pBoundary){};
1076 virtual void popClipBoundary(){};
1078 virtual void worldLine(
const OdGePoint3d pnts[2]);
1080 virtual const OdGiPathNode* currentGiPath()
const
1087 OdSmartPtr< HDGNImporter > m_pHDGNImporter;
1100 virtual double deviation(
const OdGiDeviationType t,
const OdGePoint3d& p)
const ;
1102 virtual OdGiRegenType regenType()
const {
return kOdGiRenderCommand; }
1103 virtual bool regenAbort()
const {
return false; }
1104 virtual OdGiSubEntityTraits& subEntityTraits()
const {
return (OdGiSubEntityTraits&)m_traits; }
1106 virtual bool isDragging()
const {
return false; }
1107 virtual OdUInt32 numberOfIsolines()
const {
return 4; }
1108 virtual OdGiContext* context()
const {
return pCtx; }
1109 void setContext(OdGiContext* pUserContext) { pCtx = pUserContext; }
1120 OdDbDatabase* m_pDb;
1124 OdDbDatabase* pDb) : m_pDb(pDb)
1127 OdDbBaseDatabase* database()
const
1128 {
return (OdDbBaseDatabase*)m_pDb; }
1130 OdGiDrawablePtr openDrawable(OdDbStub*) {
return (OdGiDrawable*)0; }
1136 ODRX_USING_HEAP_OPERATORS(
OdGiGeometry_<OdStaticRxObject<OdGiWorldGeometry> >);
1141 ,
OdGiGeometry_<OdStaticRxObject<OdGiWorldGeometry> >(pWireCache)
1144 virtual void draw(
const OdGiDrawable* pD)
1146 pD->worldDraw(
this);
1148 virtual OdGiGeometry& rawGeometry()
const
1150 return (OdGiGeometry&)*
this;
1152 virtual OdGiWorldGeometry& geometry()
const
1154 return (OdGiWorldGeometry&)*
this;
1157 virtual void setExtents(
const OdGePoint3d *pNewExtents) { }
1166 Model m_modelimporter;
1169 Solid m_solidimporter;
1171 Cone m_coneimporter;
1180 Arc2d m_arc2dimporter;
1181 Arc3d m_arc3dimporter;
1186 Text2d m_bText2dimporter;
1187 Text3d m_bText3dimporter;
1188 XRef m_bReferenceHeaderimporter;
1192 Mesh m_bMeshimporter;
1194 View m_viewImporter;
1206 #endif //_HDGNHelper_H__02052008_1505__
Definition: HDGNHelper.h:810
Definition: HDGNHelper.h:860
Definition: HDGNHelper.h:315
Definition: HDGNHelper.h:795
Definition: HDGNHelper.h:873
Definition: HDGNHelper.h:597
float z
The z-coordinate of a 3-dimensional point.
Definition: HGlobals.h:126
Definition: HDGNHelper.h:380
Definition: HDGNHelper.h:510
Definition: HDGNHelper.h:526
Definition: HDGNHelper.h:425
Definition: HDGNHelper.h:290
Definition: HDGNHelper.h:975
Definition: HDGNHelper.h:770
Definition: HDGNHelper.h:460
Definition: HDGNHelper.h:784
Definition: HDGNHelper.h:818
Definition: HDGNHelper.h:138
Definition: HDGNHelper.h:762
Definition: HDGNHelper.h:673
Definition: HDGNHelper.h:854
Definition: HDGNHelper.h:789
Definition: HDGNHelper.h:297
Definition: HDGNHelper.h:406
Definition: HDGNHelper.h:345
Definition: HDGNHelper.h:92
Definition: HDGNHelper.h:439
float x
The x-coordinate of a 3-dimensional point.
Definition: HGlobals.h:124
Definition: HDGNHelper.h:1133
Definition: HDGNHelper.h:957
Definition: HDGNHelper.h:497
Definition: HDGNHelper.h:327
Definition: HDGNHelper.h:534
Definition: HDGNHelper.h:401
Definition: HDGNHelper.h:657
Definition: HDGNHelper.h:363
Definition: HDGNHelper.h:628
Definition: HDGNHelper.h:688
Definition: HDGNHelper.h:1161
Definition: HDGNHelper.h:309
Definition: HDGNHelper.h:848
Definition: HDGNHelper.h:588
Definition: HDGNHelper.h:727
Definition: HDGNHelper.h:665
Definition: HDGNHelper.h:636
Definition: HDGNHelper.h:339
Definition: HDGNHelper.h:369
Definition: HDGNHelper.h:1093
Definition: HDGNHelper.h:736
float y
The y-coordinate of a 3-dimensional point.
Definition: HGlobals.h:125
Definition: HDGNHelper.h:542
Definition: HDGNHelper.h:703
The HPoint class is the data type of a three-dimensional point.
Definition: HGlobals.h:121
Definition: HDGNHelper.h:1118
Definition: HDGNHelper.h:681
Definition: HDGNHelper.h:890
Definition: HDGNHelper.h:558
Definition: HDGNHelper.h:550
Definition: HDGNHelper.h:453
Definition: HDGNHelper.h:834
Definition: HDGNHelper.h:419
Definition: HDGNHelper.h:159
Definition: HDGNHelper.h:503
Definition: HDGNHelper.h:473
Definition: HDGNHelper.h:467
Definition: HDGNHelper.h:754
Definition: HDGNHelper.h:284
Definition: HDGNHelper.h:303
Definition: HDGNHelper.h:479
Definition: HDGNHelper.h:881
Definition: HDGNHelper.h:446
Definition: HDGNHelper.h:778
Definition: HDGNHelper.h:841
Definition: HDGNHelper.h:351
Definition: HDGNHelper.h:696
Definition: HDGNHelper.h:433
Definition: HDGNHelper.h:580
A header file containing the HIO classes for passing to HBaseView::FileInput and HBaseView::FileOutpu...
Definition: HDGNHelper.h:564
Definition: HDGNHelper.h:719
Definition: HDGNHelper.h:518
Definition: HDGNHelper.h:712
Definition: HDGNHelper.h:259
Definition: HDGNHelper.h:745
Definition: HDGNHelper.h:492
Definition: HDGNHelper.h:321
Definition: HDGNHelper.h:572
Definition: HDGNHelper.h:867
Definition: HDGNHelper.h:395
Definition: HDGNHelper.h:357
Definition: HDGNHelper.h:802
Definition: HDGNHelper.h:486
Definition: HDGNHelper.h:334