HDGNHelper.h
1 // Copyright (c) Tech Soft 3D, Inc.
2 //
3 // The information contained herein is confidential and proprietary to Tech Soft 3D, Inc.,
4 // and considered a trade secret as defined under civil and criminal statutes.
5 // Tech Soft 3D, Inc. shall pursue its civil and criminal remedies in the event of
6 // unauthorized use or misappropriation of its trade secrets. Use of this information
7 // by anyone other than authorized employees of Tech Soft 3D, Inc. is granted only under
8 // a written non-disclosure agreement, expressly prescribing the scope and manner of such use.
9 
10 #ifndef _HDGNHelper_H__02052008_1505__
11 #define _HDGNHelper_H__02052008_1505__
12 
13 #include "HTools.h"
14 #include "HIOManager.h"
15 #include "vhash.h"
16 #include "vlist.h"
17 
18 // DGNdirect includes
19 #include "OdaCommon.h"
20 #include "DgDatabase.h"
21 #include "Int32Array.h"
22 #include "IntArray.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"
32 #include "Gs/Gs.h"
33 #include "ModelerDefs.h"
34 #include "DbObjectId.h"
35 #include "dbfiler.h"
36 #include "DgLevelMask.h"
37 #include "dgmodel.h"
38 #include "DgModelerGeometry/DgModelerModule.h"
39 #include "Wr/wrTriangulationParams.h"
40 
41 #include "StaticRxObject.h"
42 #include "DynamicLinker.h"
43 #include "RxDynamicModule.h"
44 #include "DgModelerGeometryCreator.h"
45 #include "ExDgnServices.h"
46 #include "ExDgnHostAppServices.h"
47 
48 #include "Gi/GiDrawable.h"
49 #include "DgLine.h"
50 #include "DgLineString.h"
51 #include "DgText.h"
52 #include "DgTextNode.h"
53 #include "DgShape.h"
54 #include "DgCurve.h"
55 #include "DgEllipse.h"
56 #include "DgArc.h"
57 #include "DgCone.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"
66 #include "DgRaster.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"
77 #include "DgView.h"
78 #include "DgSharedCellDefinition.h"
79 #include "DgSharedCellReference.h"
80 #include "DgTagSetDefinition.h"
81 #include "DgReferenceAttach.h"
82 #include "DgMesh.h"
83 #include "RxObjectImpl.h"
84 #include "resbuf.h"
85 
86 #include <set>
87 #include <string>
88 using namespace std;
89 
90 class XRef;
91 
92 class TreeNode
93 {
94 
95 private:
96 
97  char* m_pchName;
98  OdUInt16 m_nNestedDepth;
99 
100 public:
101  //write set function for this
102  VHash<char*,int> *m_vhashOfImmediateChildXref ;
103  //VList<char*> m_vlistOfImmediateChildXref;
104  VList<TreeNode*> m_ChildNodes;
105  TreeNode* m_pParentNode;
106 
107  TreeNode(char *pChNode)
108  {
109  m_pchName = new char[strlen(pChNode) + 1];
110  strcpy(m_pchName,pChNode);
111  m_ChildNodes.Flush();
112 
113  m_pParentNode = NULL;
114  m_nNestedDepth = 0;
115 
116  m_vhashOfImmediateChildXref = new VHash<char*,int>;
117  }
118 
119  ~TreeNode()
120  {
121  m_ChildNodes.Flush();
122 
123  m_vhashOfImmediateChildXref->Flush();
124 
125  H_SAFE_DELETE_ARRAY(m_pchName);
126  }
127 
128  void SetNestedDepth(OdUInt16 nNestedDepth){ m_nNestedDepth = nNestedDepth;}
129 
130  OdUInt16 GetNestedDepth(){ return m_nNestedDepth;}
131 
132  char *GetName(){ return m_pchName;}
133 
134 };
135 
136 // This class is the base class for importers of all objects.
137 // Every object class has this extension.
138 class hRxObject : public OdRxObjectImpl< OdRxObject >
139 {
140 
141 public:
142 
143  hRxObject();
144  ~hRxObject(){};
145 
146  virtual void addRef();
147  virtual void release();
148  virtual long numRefs() const;
149  virtual void import( OdRxObjectPtr object ) = 0; //each object class need to describe itself via this method
150 
151 private:
152  long m_references; //used by each object separately
153  ODRX_DECLARE_MEMBERS( hRxObject );
154 
155 };
156 
157 #define MAX_LEVEL_NAME_LEN 256
158 
159 class HDGNImporter : public hRxObject
160 {
161 public:
162 
163  HDGNImporter(){;};
164  ~HDGNImporter(){;};
165 
166  void setDatabase(OdDgDatabasePtr database){ pDb = database ;};
167 
168  inline void OdGePoint2d_2_HPoint(const OdGePoint2d* odg_point, HPoint& h_point)
169  {
170  h_point.x = odg_point->x;
171  h_point.y = odg_point->y;
172  h_point.z = 0.0f;
173  }
174 
175  inline void OdGePoint3d_2_HPoint(const OdGePoint3d* odg_point, HPoint& h_point)
176  {
177  h_point.x = odg_point->x;
178  h_point.y = odg_point->y;
179  h_point.z = odg_point->z;
180  }
181 
182  void setInputHandler(HInputHandler* hand){ m_inputHandler= hand;};
183 
184  HFileInputResult FileInputByKey(const char * FileName, HC_KEY model_key, HInputHandlerOptions * options);
185  bool importDGNFile( const char * FileName, bool isXrefPresent);
186  OdDgModelPtr getActiveModel(OdDgDatabasePtr pDatabase);
187 
188  virtual void import( OdRxObjectPtr object ){;};
189  //In iterateElm "int CHeaderid=0" is loaded by default as a"0" bby assuming CellHeader id will not be 0.
190  void iterateElm( OdDgElementIteratorPtr iterator, bool visibilityProcessing, bool checkProgress,int CHeaderid=0);
191 
192  HC_KEY getLevelKey( OdDgGraphicsElementPtr grElm );
193 
194  void setLineStyleAndWt(OdDgGraphicsElementPtr grElm);
195 
196  void importXData (OdResBufPtr pRb);
197 
198  int calculateTotalEntities( OdRxObjectPtr object );
199 
200  void importCellheaderWithHoleAttr();
201  bool AddGeometryInList(bool);
202 
203  bool isAttachedXREF(const char* FileName);
204 
205  //Vinit changes
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);
210 
211 
212 protected:
213 
214  //if m_bDGNImportAllModels = true importing all the models available in DGN file.
215  //default value is m_bDGNImportAllModels = false - Vinit M
216 
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;
229  static HInputHandler* m_inputHandler;
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;
234 
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;
242 
243  enum {SINGLE_ENTITY_CELLHEADER, BREAK_CELLHEADER, OPT_CELLHEADER};
244  static int m_iCellHeaderOption ;
245 
246 private:
247 
248  VStringHash<int> imported_xrefs;
249  void resetStaticVars();
250 
251 
252  //declare OdGiGeometry_ as friend of this class
253  template<class> friend class OdGiGeometry_;
254  friend class OdGiGeometry_ <class T>;
255 
256 
257 };
258 
259 class XRef : public HDGNImporter
260 {
261 
262 public:
263 
264  XRef()
265  {
266  };
267 
268  ~XRef()
269  {
270  m_listOfXRefs.Flush();
271  m_listOfXRefsOfXRefs.Flush();
272  };
273 
274  void populateXREFs();
275  VList<char*> m_listOfXRefsOfXRefs;
276 
277 private:
278  VList<char*> m_listOfXRefs;
279  char* m_cXRefSegName;
280  void import( OdRxObjectPtr object );
281  void fillVlistOfXref(OdDgReferenceAttachmentHeaderPtr element);
282 };
283 
284 class Database : public HDGNImporter
285 {
286  void import( OdRxObjectPtr object );
287 };
288 
289 
290 class Model : public HDGNImporter
291 {
292 public:
293  void import( OdRxObjectPtr object );
294 };
295 
296 
297 class Line2d : public HDGNImporter
298 {
299  void import( OdRxObjectPtr object );
300 };
301 
302 
303 class Line3d : public HDGNImporter
304 {
305  void import( OdRxObjectPtr object );
306 };
307 
308 
310 {
311  void import( OdRxObjectPtr object );
312 };
313 
314 
316 {
317  void import( OdRxObjectPtr object );
318 };
319 
320 
321 class Text2d : public HDGNImporter
322 {
323  void import( OdRxObjectPtr object );
324 };
325 
326 
327 class Text3d : public HDGNImporter
328 {
329  void import( OdRxObjectPtr object );
330 
331 };
332 
333 
334 class TextNode2d : public HDGNImporter
335 {
336  void import( OdRxObjectPtr object );
337 };
338 
339 class TextNode3d : public HDGNImporter
340 {
341  void import( OdRxObjectPtr object );
342 };
343 
344 
345 class Shape2d : public HDGNImporter
346 {
347  void import( OdRxObjectPtr object );
348 };
349 
350 
351 class Shape3d : public HDGNImporter
352 {
353  void import( OdRxObjectPtr object );
354 };
355 
356 
357 class Curve2d : public HDGNImporter
358 {
359  void import( OdRxObjectPtr object ){};
360 };
361 
362 
363 class Curve3d : public HDGNImporter
364 {
365  void import( OdRxObjectPtr object ){};
366 };
367 
368 
369 class Arc2d : public HDGNImporter
370 {
371 private:
372  void import( OdRxObjectPtr object );
373 
374 public:
375  void importAsEllipticalArc(OdGeEllipArc2d ellipArc, double rot_angle, bool isClosed);
376 
377 };
378 
379 
380 class Arc3d : public HDGNImporter
381 {
382 private:
383  void import( OdRxObjectPtr object );
384 public:
385  void importAsEllipticalArc(OdGeEllipArc3d ellipArc, bool isClosed);
386 
387  //declare OdGiGeometry_ as friend of this class
388  template<class> friend class OdGiGeometry_;
389  friend class OdGiGeometry_ <class T>;
390 
391 };
392 
393 
394 //Case of multilevel inheritence : Mustafa B
395 class Ellipse2d :public Arc2d
396 {
397  void import( OdRxObjectPtr object );
398 };
399 
400 
401 class Ellipse3d : public Arc3d
402 {
403  void import( OdRxObjectPtr object );
404 };
405 
406 class Cone : public HDGNImporter
407 {
408 
409  static double m_dDeviationForCone;
410  void import( OdRxObjectPtr object );
411 
412  //declare OdGiCommonDraw_ as friend of this class
413  template<class> friend class OdGiCommonDraw_;
414  friend class OdGiCommonDraw_ <class T>;
415 
416 };
417 
418 
420 {
421  void import( OdRxObjectPtr object ){};
422 };
423 
424 
426 {
427 
428  void import( OdRxObjectPtr object );
429 
430 };
431 
432 
434 {
435  void import( OdRxObjectPtr object ){};
436 };
437 
438 
440 {
441  void import( OdRxObjectPtr object ){};
442 
443 };
444 
445 
446 class Dimension : public HDGNImporter
447 {
448  void import( OdRxObjectPtr object );
449 
450 };
451 
452 
453 class Multiline : public HDGNImporter
454 {
455  void import( OdRxObjectPtr object ){};
456 
457 };
458 
459 
461 {
462  void import( OdRxObjectPtr object ){};
463 
464 };
465 
466 
468 {
469  void import( OdRxObjectPtr object ){};
470 };
471 
472 
474 {
475  void import( OdRxObjectPtr object ){};
476 
477 };
478 
480 {
481  void import( OdRxObjectPtr object ){};
482 
483 };
484 
485 
486 class BSpline : public HDGNImporter
487 {
488 public:
489  void getUniformKnots(bool isClosed, int totalKnots, int order, float*& hKnots);
490 };
491 
492 class BSplineCurve2d : public BSpline
493 {
494  void import( OdRxObjectPtr object );
495 };
496 
497 class BSplineCurve3d : public BSpline
498 {
499  void import( OdRxObjectPtr object );
500 };
501 
502 
503 class BSplineSurface : public BSpline
504 {
505 
506  void import( OdRxObjectPtr object );
507 };
508 
509 
510 class Surface : public HDGNImporter
511 {
512 
513  void import( OdRxObjectPtr object );
514 
515 };
516 
517 
518 class Solid : public HDGNImporter
519 {
520 
521  void import( OdRxObjectPtr object );
522 
523 };
524 
525 
527 {
528 
529  void import( OdRxObjectPtr object ){};
530 
531 };
532 
533 
535 {
536  void import( OdRxObjectPtr object ){};
537 };
538 
539 
540 
541 
543 {
544 
545  void import( OdRxObjectPtr object ){};
546 
547 };
548 
549 
551 {
552 
553  void import( OdRxObjectPtr object ){};
554 
555 };
556 
557 
559 {
560  void import( OdRxObjectPtr object ){};
561 };
562 
563 
565 {
566 
567  void import( OdRxObjectPtr object ){};
568 
569 };
570 
571 
573 {
574 
575  void import( OdRxObjectPtr object ){};
576 
577 };
578 
579 
581 {
582 
583  void import( OdRxObjectPtr object ){};
584 
585 };
586 
587 
589 {
590 
591  void import( OdRxObjectPtr object ){};
592 
593 
594 };
595 
596 
598 {
599 
600  void import( OdRxObjectPtr object ){};
601 
602 };
603 
604 
606 {
607 
608  void import( OdRxObjectPtr object ){};
609 
610 };
611 
612 
614 {
615 
616  void import( OdRxObjectPtr object ){};
617 
618 };
619 
620 
622 {
623  void import( OdRxObjectPtr object ){};
624 
625 };
626 
627 
629 {
630 
631  void import( OdRxObjectPtr object ){};
632 
633 };
634 
635 
636 class TagElement : public HDGNImporter
637 {
638 
639  void import( OdRxObjectPtr object ){};
640 
641 
642 };
643 
644 
646 {
647 
648  void import( OdRxObjectPtr object );
649 };
650 
651 
653 {
654  void import( OdRxObjectPtr object );
655 };
656 
657 class LevelTable : public HDGNImporter
658 {
659 
660  void import( OdRxObjectPtr object ){};
661 
662 };
663 
664 
666 {
667 
668  void import( OdRxObjectPtr object ){};
669 
670 };
671 
672 
673 class FontTable : public HDGNImporter
674 {
675 
676  void import( OdRxObjectPtr object ){};
677 
678 };
679 
680 
682 {
683  void import( OdRxObjectPtr object ){};
684 
685 };
686 
687 
689 {
690 
691  void import( OdRxObjectPtr object ){};
692 
693 };
694 
695 
697 {
698  void import( OdRxObjectPtr object ){};
699 
700 };
701 
702 
704 {
705 
706  void import( OdRxObjectPtr object ){};
707 
708 
709 };
710 
711 
713 {
714  void import( OdRxObjectPtr object ){};
715 
716 };
717 
718 
720 {
721 
722  void import( OdRxObjectPtr object ){};
723 
724 };
725 
726 
728 {
729 
730  void import( OdRxObjectPtr object ){};
731 
732 
733 };
734 
735 
737 {
738 
739  void import( OdRxObjectPtr object ){};
740 
741 
742 };
743 
744 
746 {
747 
748  void import( OdRxObjectPtr object ){};
749 
750 
751 };
752 
753 
754 class RegAppTable : public HDGNImporter
755 {
756 
757  void import( OdRxObjectPtr object ){};
758 
759 };
760 
761 
763 {
764 
765  void import( OdRxObjectPtr object ){};
766 
767 };
768 
769 
770 class ViewTable : public HDGNImporter
771 {
772 
773  void import( OdRxObjectPtr object ){};
774 
775 };
776 
777 
778 class View : public HDGNImporter
779 {
780  void import( OdRxObjectPtr object );
781 
782 };
783 
785 {
786  void import( OdRxObjectPtr object );
787 };
788 
789 class ViewGroup : public HDGNImporter
790 {
791 
792  void import( OdRxObjectPtr object );
793 };
794 
796 {
797  void import( OdRxObjectPtr object ){};
798 
799 };
800 
801 
803 {
804 
805  void import( OdRxObjectPtr object );
806 
807 };
808 
809 
811 {
812 
813  void import( OdRxObjectPtr object );
814 
815 
816 };
817 
819 {
820 public:
822  {
823  m_iSharedCellRefCounter = 0;
824  m_bSharedCellDefTable = false;
825  };
826 
827 private:
828  int m_iSharedCellRefCounter;
829  bool m_bSharedCellDefTable;
830  void import( OdRxObjectPtr object );
831 };
832 
833 
835 {
836  void import( OdRxObjectPtr object ){};
837 
838 };
839 
840 
842 {
843  void import( OdRxObjectPtr object ){};
844 
845 };
846 
847 
849 {
850  void import( OdRxObjectPtr object ){};
851 
852 };
853 
855 {
856  void import( OdRxObjectPtr object ){};
857 
858 };
859 
861 {
862  void import( OdRxObjectPtr object ){};
863 
864 };
865 
866 
867 class ColorTable : public HDGNImporter
868 {
869  void import( OdRxObjectPtr object ){};
870 
871 };
872 
873 class Mesh : public HDGNImporter
874 {
875  void import( OdRxObjectPtr object );
876 
877 };
878 
879 //worlddraw() callback classes
880 
881 class HOdExDgnSystemServices : public OdExDgnSystemServices,
882  public OdExDgnHostAppServices
883 {
884  ODRX_USING_HEAP_OPERATORS(OdExDgnSystemServices);
885 };
886 
887 extern OdStaticRxObject< HOdExDgnSystemServices > g_HIO_OdExDgnSystemServices ;
888 
889 //worldDraw() class
890 class sampleTraits : public OdStaticRxObject<OdGiSubEntityTraits>
891 {
892  //ODRX_DECLARE_MEMBERS(OdGiSubEntityTraits);
893 
894  virtual void setColor(OdUInt16 color) {}
895 
896  virtual void setTrueColor(const OdCmEntityColor& cmColor) {}
897 
898  virtual void setLayer(OdDbStub* layerId) {}
899 
900  virtual void setLineType(OdDbStub* linetypeId) {}
901 
902  virtual void setSelectionMarker(OdGsMarker markerId) {}
903 
904  virtual void setFillType(OdGiFillType fillType) {}
905 
906  virtual void setFillPlane(const OdGeVector3d* /*pNormal*/ = 0) {}
907 
908  virtual void setLineWeight(OdDb::LineWeight lw) {}
909 
910  virtual void setLineTypeScale(double dScale = 1.0) {}
911 
912  virtual void setLineTypeScaleToFit(bool /*doIt*/) /*= 0*/ {};
913 
914  virtual void setThickness(double dThickness) {}
915 
916  virtual void setPlotStyleName(OdDb::PlotStyleNameType, OdDbStub* = 0) {}
917 
918  virtual void setMaterial(OdDbStub* /*materialId*/) {}
919 
920  virtual void setMapper(const OdGiMapper * /*pMapper*/) {}
921 
922  virtual void setVisualStyle(const OdDbStub* /*visualStyleId*/) {}
923 
924  virtual OdUInt16 color() const { return 0; }
925 
926  virtual OdCmEntityColor trueColor() const { return OdCmEntityColor(); }
927 
928  virtual OdDbStub* layer() const { return 0; }
929 
930  virtual OdDbStub* lineType() const { return 0; }
931 
932  virtual OdGiFillType fillType() const { return kOdGiFillAlways; }
933 
934  virtual bool fillPlane(OdGeVector3d& /*normal*/) { return false; }
935 
936  virtual OdDb::LineWeight lineWeight() const { return OdDb::kLnWtByLwDefault; }
937 
938  virtual double lineTypeScale() const { return 0.; }
939 
940  virtual double thickness() const { return 0.; }
941 
942  virtual OdDb::PlotStyleNameType plotStyleNameType() const { return OdDb::kPlotStyleNameByLayer; }
943 
944  virtual OdDbStub* plotStyleNameId() const { return 0; }
945 
946  virtual OdDbStub* material() const { return 0; }
947 
948  virtual const OdGiMapper* mapper() const { return 0; }
949 
950  virtual OdDbStub* visualStyle() const { return 0; }
951 
952  virtual void addLight(const OdDbStub* lightId){}
953 
954 };
955 
956 //worldDraw() class
958 {
959 public:
960 
961  OdGePoint3dArray pnts;
962  OdInt32Array faces;
963 
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)
965  {
966  pnts.resize(numVertices);
967  memcpy(pnts.asArrayPtr(), vertexList, sizeof(OdGePoint3d)*numVertices);
968  faces.resize(faceListSize);
969  memcpy(faces.asArrayPtr(), faceList, sizeof(OdInt32)*faceListSize);
970  }
971 };
972 
973 //worldDraw() class
974 template<class T>
975 class OdGiGeometry_ : public T
976 {
977 
978 public:
979  OdArray<shellStore> &m_WireCache;
980 
981  shellStore *appendWire()
982  {
983  shellStore *pWire = m_WireCache.append();
984  return pWire;
985  }
986 
987  OdGiGeometry_(OdArray<shellStore> &pWireCache)
988  : m_WireCache(pWireCache)
989  {
990  }
991 
992  virtual void pline(const OdGiPolyline& pline , OdUInt32 n1 , OdUInt32 n2 );
993 
994 
995  virtual OdGeMatrix3d getModelToWorldTransform() const
996  {
997  return OdGeMatrix3d();
998  };
999  virtual OdGeMatrix3d getWorldToModelTransform() const
1000  {
1001  return OdGeMatrix3d();
1002  };
1003 
1004  virtual void pushModelTransform(const OdGeVector3d& vNormal){};
1005 
1006  virtual void pushModelTransform(const OdGeMatrix3d& xMat);
1007 
1008  virtual void popModelTransform(){};
1009 
1010 
1011  // For drawing various primitives.
1012  //
1013  virtual void circle(const OdGePoint3d& center, double radius, const OdGeVector3d& normal);
1014 
1015  virtual void circle(const OdGePoint3d& p1, const OdGePoint3d& p2, const OdGePoint3d& p3);
1016 
1017  virtual void circularArc(const OdGePoint3d& center,double radius,
1018  const OdGeVector3d& normal,const OdGeVector3d& startVector,
1019  double sweepAngle,OdGiArcType arcType = kOdGiArcSimple);
1020 
1021 
1022  virtual void circularArc(const OdGePoint3d& start,const OdGePoint3d& point,
1023  const OdGePoint3d& end,OdGiArcType arcType = kOdGiArcSimple);
1024 
1025 
1026  virtual void polyline(OdInt32 nbPoints,const OdGePoint3d* pVertexList,
1027  const OdGeVector3d* pNormal = NULL,OdGsMarker lBaseSubEntMarker = -1) ;
1028 
1029 
1030  virtual void polygon(OdInt32 nbPoints, const OdGePoint3d* pVertexList);
1031 
1032 
1033  virtual void mesh(OdInt32 rows,
1034  OdInt32 columns,
1035  const OdGePoint3d* pVertexList,
1036  const OdGiEdgeData* pEdgeData = NULL,
1037  const OdGiFaceData* pFaceData = NULL,
1038  const OdGiVertexData* pVertexData = NULL);
1039 
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 );
1047 
1048  virtual void text(const OdGePoint3d& position,
1049  const OdGeVector3d& normal, const OdGeVector3d& direction,
1050  double height, double width, double oblique, const OdString& msg);
1051 
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);
1055 
1056 
1057  void ray(const OdGePoint3d& first, const OdGePoint3d& second);
1058 
1059  virtual void nurbs(const OdGeNurbCurve3d& nurbs){};
1060 
1061  virtual void xline(const OdGePoint3d& p1, const OdGePoint3d& p2);
1062 
1063  virtual void ellipArc(const OdGeEllipArc3d& arc,
1064  const OdGePoint3d* pEndPointsOverrides = 0,
1065  OdGiArcType arcType = kOdGiArcSimple);
1066 
1067  virtual void image(const OdGiImageBGRA32 &, const OdGePoint3d &, const OdGeVector3d &, const OdGeVector3d &, OdGiRasterImage::TransparencyMode);
1068 
1069  virtual void edge(const OdGiEdge2dArray &);
1070 
1071  virtual void draw(const OdGiDrawable* pD)
1072  {
1073  // OdGiDrawable::DrawableType drawable = pD->drawableType();
1074  pD->drawableType();
1075  }
1076 
1077  // If you push a clip boundary onto the stack you must pop it;
1078  //
1079  virtual void pushClipBoundary(OdGiClipBoundary* pBoundary){};
1080  virtual void popClipBoundary(){};
1081 
1082  virtual void worldLine(const OdGePoint3d pnts[2]);
1083 
1084  virtual const OdGiPathNode* currentGiPath() const
1085  {
1086  return 0;
1087  }
1088 
1089 private:
1090  OdGiGeometry_();
1091  OdSmartPtr< HDGNImporter > m_pHDGNImporter;
1092  Arc3d m_arc3d;
1093 };
1094 
1095 
1096 template<class T>
1097 class OdGiCommonDraw_ : public T
1098 {
1099  OdGiContext* pCtx;
1100 public:
1101 
1102  OdGiCommonDraw_() {}
1103 
1104  virtual double deviation(const OdGiDeviationType t, const OdGePoint3d& p) const ;
1105 
1106  virtual OdGiRegenType regenType() const { return kOdGiRenderCommand; }
1107  virtual bool regenAbort() const { return false; }
1108  virtual OdGiSubEntityTraits& subEntityTraits() const { return (OdGiSubEntityTraits&)m_traits; }
1109  //virtual OdGiSubEntityTraits& subEntityTraits() const { return (OdGiSubEntityTraits&)*this; }
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; }
1114 
1115 
1116 private:
1117  Cone m_cone;
1118  sampleTraits m_traits;
1119 };
1120 
1121 //Setting the contex for worlddraw() function.
1122 class OdGiContextDumper : public OdStaticRxObject<OdGiContext>
1123 {
1124  OdDbDatabase* m_pDb;
1125 
1126 public:
1128  OdDbDatabase* pDb) : m_pDb(pDb)
1129  {}
1130 
1131  OdDbBaseDatabase* database() const
1132  { return (OdDbBaseDatabase*)m_pDb; }
1133 
1134  OdGiDrawablePtr openDrawable(OdDbStub*) { return (OdGiDrawable*)0; }
1135 };
1136 
1137 class OdWiresWorldGeometry : public OdGiGeometry_<OdStaticRxObject<OdGiWorldGeometry> >
1138  , public OdGiCommonDraw_<OdStaticRxObject<OdGiWorldDraw> >
1139 {
1140  ODRX_USING_HEAP_OPERATORS(OdGiGeometry_<OdStaticRxObject<OdGiWorldGeometry> >);
1141 
1142 public:
1143  OdWiresWorldGeometry(OdArray<shellStore> &pWireCache)
1145  , OdGiGeometry_<OdStaticRxObject<OdGiWorldGeometry> >(pWireCache)
1146  {
1147  }
1148  virtual void draw(const OdGiDrawable* pD)
1149  {
1150  pD->worldDraw(this);
1151  }
1152  virtual OdGiGeometry& rawGeometry() const
1153  {
1154  return (OdGiGeometry&)*this;
1155  }
1156  virtual OdGiWorldGeometry& geometry() const
1157  {
1158  return (OdGiWorldGeometry&)*this;
1159  }
1160 
1161  virtual void setExtents(const OdGePoint3d *pNewExtents) { }
1162 };
1163 //Callback code for worldDraw() function ends
1164 
1166 {
1167 private:
1168 
1169  Database m_databaseimporter;
1170  Model m_modelimporter;
1171  CellHeader2d m_cellHeader2dimporter;
1172  CellHeader3d m_cellHeader3dimporter;
1173  Solid m_solidimporter;
1174  Surface m_surfaceimporter;
1175  Cone m_coneimporter;
1176  Line2d m_line2dimporter;
1177  Line3d m_line3dimporter;
1178  LineString2d m_lineString2dimporter;
1179  LineString3d m_lineString3dimporter;
1180  Shape2d m_shape2dimporter;
1181  Shape3d m_shape3dimporter;
1182  Ellipse2d m_ellipse2dimporter;
1183  Ellipse3d m_ellipse3dimporter;
1184  Arc2d m_arc2dimporter;
1185  Arc3d m_arc3dimporter;
1186  ComplexShape m_complexShapeimporter;
1187  BSplineCurve2d m_bSplineCurve2dimporter;
1188  BSplineCurve3d m_bSplineCurve3dimporter;
1189  BSplineSurface m_bSplineSurfaceimporter;
1190  Text2d m_bText2dimporter;
1191  Text3d m_bText3dimporter;
1192  XRef m_bReferenceHeaderimporter;
1193  SharedCellDefinition m_bSharedCellDefinitionimporter;
1194  SharedCellDefinitionTable m_bSharedCellDefinitionTableimporter;
1195  SharedCellReference m_bSharedCellReferenceimporter ;
1196  Mesh m_bMeshimporter;
1197  Dimension m_dimensionImporter;
1198  View m_viewImporter;
1199  ViewGroupTable m_viewGroupTableImporter;
1200  ViewGroup m_viewGroupImporter;
1201  TextNode2d m_textNode2dImporter;
1202  TextNode3d m_textNode3dImporter;
1203 
1204 
1205 public:
1206  OdDgImporter();
1207  ~OdDgImporter();
1208 };
1209 
1210 #endif //_HDGNHelper_H__02052008_1505__
1211 
1212 
1213 
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:605
Definition: HDGNHelper.h:784
Definition: HUtilityPMI.h:147
Definition: HDGNHelper.h:818
Definition: HDGNHelper.h:652
Definition: HDGNHelper.h:138
Definition: HDGNHelper.h:762
HInputHandler an abstract base class for model and image input.
Definition: HIOManager.h:671
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:1137
Definition: HDGNHelper.h:957
Definition: HDGNHelper.h:497
Definition: HDGNHelper.h:327
Definition: HDGNHelper.h:621
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:1165
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:1097
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:1122
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:645
Definition: HDGNHelper.h:881
Definition: HDGNHelper.h:778
Definition: HIOManager.h:246
Definition: HDGNHelper.h:841
Definition: HDGNHelper.h:351
Definition: HDGNHelper.h:696
Definition: HDGNHelper.h:433
Definition: HDGNHelper.h:613
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