Alphabetical Class Index  Class Hierarchy   File Members   Compound Members   File List  

HDGNHelper.h
1 //
2 // Copyright (c) 2005 by Tech Soft 3D, LLC.
3 // The information contained herein is confidential and proprietary to
4 // Tech Soft 3D, LLC., and considered a trade secret as defined under
5 // civil and criminal statutes. Tech Soft 3D shall pursue its civil
6 // and criminal remedies in the event of unauthorized use or misappropriation
7 // of its trade secrets. Use of this information by anyone other than
8 // authorized employees of Tech Soft 3D, LLC. is granted only under a
9 // written non-disclosure agreement, expressly prescribing the scope and
10 // manner of such use.
11 //
12 // $Id: 4afec826a33a8b0960a32a349071b815dea7a399 $
13 //
14 #ifndef _HDGNHelper_H__02052008_1505__
15 #define _HDGNHelper_H__02052008_1505__
16 
17 #include "HTools.h"
18 #include "HIOManager.h"
19 #include "vhash.h"
20 #include "vlist.h"
21 
22 // DGNdirect includes
23 #include "OdaCommon.h"
24 #include "DgDatabase.h"
25 #include "Int32Array.h"
26 #include "IntArray.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"
36 #include "Gs/Gs.h"
37 #include "ModelerDefs.h"
38 #include "DbObjectId.h"
39 #include "dbfiler.h"
40 #include "DgLevelMask.h"
41 #include "dgmodel.h"
42 #include "DgModelerGeometry/DgModelerModule.h"
43 #include "Wr/wrTriangulationParams.h"
44 
45 #include "StaticRxObject.h"
46 #include "DynamicLinker.h"
47 #include "RxDynamicModule.h"
48 #include "DgModelerGeometryCreator.h"
49 #include "ExDgnServices.h"
50 #include "ExDgnHostAppServices.h"
51 
52 #include "Gi/GiDrawable.h"
53 #include "DgLine.h"
54 #include "DgLineString.h"
55 #include "DgText.h"
56 #include "DgTextNode.h"
57 #include "DgShape.h"
58 #include "DgCurve.h"
59 #include "DgEllipse.h"
60 #include "DgArc.h"
61 #include "DgCone.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"
70 #include "DgRaster.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"
81 #include "DgView.h"
82 #include "DgSharedCellDefinition.h"
83 #include "DgSharedCellReference.h"
84 #include "DgTagSetDefinition.h"
85 #include "DgReferenceAttach.h"
86 #include "DgMesh.h"
87 #include "RxObjectImpl.h"
88 #include "resbuf.h"
89 
90 #include <set>
91 #include <string>
92 using namespace std;
93 
94 class XRef;
95 
96 class TreeNode
97 {
98 
99 private:
100 
101  char* m_pchName;
102  OdUInt16 m_nNestedDepth;
103 
104 public:
105  //write set function for this
106  VHash<char*,int> *m_vhashOfImmediateChildXref ;
107  //VList<char*> m_vlistOfImmediateChildXref;
108  VList<TreeNode*> m_ChildNodes;
109  TreeNode* m_pParentNode;
110 
111  TreeNode(char *pChNode)
112  {
113  m_pchName = new char[strlen(pChNode) + 1];
114  strcpy(m_pchName,pChNode);
115  m_ChildNodes.Flush();
116 
117  m_pParentNode = NULL;
118  m_nNestedDepth = 0;
119 
120  m_vhashOfImmediateChildXref = new VHash<char*,int>;
121  }
122 
123  ~TreeNode()
124  {
125  m_ChildNodes.Flush();
126 
127  m_vhashOfImmediateChildXref->Flush();
128 
129  H_SAFE_DELETE_ARRAY(m_pchName);
130  }
131 
132  void SetNestedDepth(OdUInt16 nNestedDepth){ m_nNestedDepth = nNestedDepth;}
133 
134  OdUInt16 GetNestedDepth(){ return m_nNestedDepth;}
135 
136  char *GetName(){ return m_pchName;}
137 
138 };
139 
140 // This class is the base class for importers of all objects.
141 // Every object class has this extension.
142 class hRxObject : public OdRxObjectImpl< OdRxObject >
143 {
144 
145 public:
146 
147  hRxObject();
148  ~hRxObject(){};
149 
150  virtual void addRef();
151  virtual void release();
152  virtual long numRefs() const;
153  virtual void import( OdRxObjectPtr object ) = 0; //each object class need to describe itself via this method
154 
155 private:
156  long m_references; //used by each object separately
157  ODRX_DECLARE_MEMBERS( hRxObject );
158 
159 };
160 
161 #define MAX_LEVEL_NAME_LEN 256
162 
163 class HDGNImporter : public hRxObject
164 {
165 public:
166 
167  HDGNImporter(){;};
168  ~HDGNImporter(){;};
169 
170  void setDatabase(OdDgDatabasePtr database){ pDb = database ;};
171 
172  inline void OdGePoint2d_2_HPoint(const OdGePoint2d* odg_point, HPoint& h_point)
173  {
174  h_point.x = odg_point->x;
175  h_point.y = odg_point->y;
176  h_point.z = 0.0f;
177  }
178 
179  inline void OdGePoint3d_2_HPoint(const OdGePoint3d* odg_point, HPoint& h_point)
180  {
181  h_point.x = odg_point->x;
182  h_point.y = odg_point->y;
183  h_point.z = odg_point->z;
184  }
185 
186  void setInputHandler(HInputHandler* hand){ m_inputHandler= hand;};
187 
188  HFileInputResult FileInputByKey(const char * FileName, HC_KEY model_key, HInputHandlerOptions * options);
189  bool importDGNFile( const char * FileName, bool isXrefPresent);
190  OdDgModelPtr getActiveModel(OdDgDatabasePtr pDatabase);
191 
192  virtual void import( OdRxObjectPtr object ){;};
193  //In iterateElm "int CHeaderid=0" is loaded by default as a"0" bby assuming CellHeader id will not be 0.
194  void iterateElm( OdDgElementIteratorPtr iterator, bool visibilityProcessing, bool checkProgress,int CHeaderid=0);
195 
196  HC_KEY getLevelKey( OdDgGraphicsElementPtr grElm );
197 
198  void setLineStyleAndWt(OdDgGraphicsElementPtr grElm);
199 
200  void importXData (OdResBufPtr pRb);
201 
202  int calculateTotalEntities( OdRxObjectPtr object );
203 
204  void importCellheaderWithHoleAttr();
205  bool AddGeometryInList(bool);
206 
207  bool isAttachedXREF(const char* FileName);
208 
209  //Vinit changes
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);
214 
215 
216 protected:
217 
218  //if m_bDGNImportAllModels = true importing all the models available in DGN file.
219  //default value is m_bDGNImportAllModels = false - Vinit M
220 
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;
233  static HInputHandler* m_inputHandler;
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;
238 
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;
246 
247  enum {SINGLE_ENTITY_CELLHEADER, BREAK_CELLHEADER, OPT_CELLHEADER};
248  static int m_iCellHeaderOption ;
249 
250 private:
251 
252  VStringHash<int> imported_xrefs;
253  void resetStaticVars();
254 
255 
256  //declare OdGiGeometry_ as friend of this class
257  template<class> friend class OdGiGeometry_;
258  friend class OdGiGeometry_ <class T>;
259 
260 
261 };
262 
263 class XRef : public HDGNImporter
264 {
265 
266 public:
267 
268  XRef()
269  {
270  };
271 
272  ~XRef()
273  {
274  m_listOfXRefs.Flush();
275  m_listOfXRefsOfXRefs.Flush();
276  };
277 
278  void populateXREFs();
279  VList<char*> m_listOfXRefsOfXRefs;
280 
281 private:
282  VList<char*> m_listOfXRefs;
283  char* m_cXRefSegName;
284  void import( OdRxObjectPtr object );
285  void fillVlistOfXref(OdDgReferenceAttachmentHeaderPtr element);
286 };
287 
288 class Database : public HDGNImporter
289 {
290  void import( OdRxObjectPtr object );
291 };
292 
293 
294 class Model : public HDGNImporter
295 {
296 public:
297  void import( OdRxObjectPtr object );
298 };
299 
300 
301 class Line2d : public HDGNImporter
302 {
303  void import( OdRxObjectPtr object );
304 };
305 
306 
307 class Line3d : public HDGNImporter
308 {
309  void import( OdRxObjectPtr object );
310 };
311 
312 
314 {
315  void import( OdRxObjectPtr object );
316 };
317 
318 
320 {
321  void import( OdRxObjectPtr object );
322 };
323 
324 
325 class Text2d : public HDGNImporter
326 {
327  void import( OdRxObjectPtr object );
328 };
329 
330 
331 class Text3d : public HDGNImporter
332 {
333  void import( OdRxObjectPtr object );
334 
335 };
336 
337 
338 class TextNode2d : public HDGNImporter
339 {
340  void import( OdRxObjectPtr object );
341 };
342 
343 class TextNode3d : public HDGNImporter
344 {
345  void import( OdRxObjectPtr object );
346 };
347 
348 
349 class Shape2d : public HDGNImporter
350 {
351  void import( OdRxObjectPtr object );
352 };
353 
354 
355 class Shape3d : public HDGNImporter
356 {
357  void import( OdRxObjectPtr object );
358 };
359 
360 
361 class Curve2d : public HDGNImporter
362 {
363  void import( OdRxObjectPtr object ){};
364 };
365 
366 
367 class Curve3d : public HDGNImporter
368 {
369  void import( OdRxObjectPtr object ){};
370 };
371 
372 
373 class Arc2d : public HDGNImporter
374 {
375 private:
376  void import( OdRxObjectPtr object );
377 
378 public:
379  void importAsEllipticalArc(OdGeEllipArc2d ellipArc, double rot_angle, bool isClosed);
380 
381 };
382 
383 
384 class Arc3d : public HDGNImporter
385 {
386 private:
387  void import( OdRxObjectPtr object );
388 public:
389  void importAsEllipticalArc(OdGeEllipArc3d ellipArc, bool isClosed);
390 
391  //declare OdGiGeometry_ as friend of this class
392  template<class> friend class OdGiGeometry_;
393  friend class OdGiGeometry_ <class T>;
394 
395 };
396 
397 
398 //Case of multilevel inheritence : Mustafa B
399 class Ellipse2d :public Arc2d
400 {
401  void import( OdRxObjectPtr object );
402 };
403 
404 
405 class Ellipse3d : public Arc3d
406 {
407  void import( OdRxObjectPtr object );
408 };
409 
410 class Cone : public HDGNImporter
411 {
412 
413  static double m_dDeviationForCone;
414  void import( OdRxObjectPtr object );
415 
416  //declare OdGiCommonDraw_ as friend of this class
417  template<class> friend class OdGiCommonDraw_;
418  friend class OdGiCommonDraw_ <class T>;
419 
420 };
421 
422 
424 {
425  void import( OdRxObjectPtr object ){};
426 };
427 
428 
430 {
431 
432  void import( OdRxObjectPtr object );
433 
434 };
435 
436 
438 {
439  void import( OdRxObjectPtr object ){};
440 };
441 
442 
444 {
445  void import( OdRxObjectPtr object ){};
446 
447 };
448 
449 
450 class Dimension : public HDGNImporter
451 {
452  void import( OdRxObjectPtr object );
453 
454 };
455 
456 
457 class Multiline : public HDGNImporter
458 {
459  void import( OdRxObjectPtr object ){};
460 
461 };
462 
463 
465 {
466  void import( OdRxObjectPtr object ){};
467 
468 };
469 
470 
472 {
473  void import( OdRxObjectPtr object ){};
474 };
475 
476 
478 {
479  void import( OdRxObjectPtr object ){};
480 
481 };
482 
484 {
485  void import( OdRxObjectPtr object ){};
486 
487 };
488 
489 
490 class BSpline : public HDGNImporter
491 {
492 public:
493  void getUniformKnots(bool isClosed, int totalKnots, int order, float*& hKnots);
494 };
495 
496 class BSplineCurve2d : public BSpline
497 {
498  void import( OdRxObjectPtr object );
499 };
500 
501 class BSplineCurve3d : public BSpline
502 {
503  void import( OdRxObjectPtr object );
504 };
505 
506 
507 class BSplineSurface : public BSpline
508 {
509 
510  void import( OdRxObjectPtr object );
511 };
512 
513 
514 class Surface : public HDGNImporter
515 {
516 
517  void import( OdRxObjectPtr object );
518 
519 };
520 
521 
522 class Solid : public HDGNImporter
523 {
524 
525  void import( OdRxObjectPtr object );
526 
527 };
528 
529 
531 {
532 
533  void import( OdRxObjectPtr object ){};
534 
535 };
536 
537 
539 {
540  void import( OdRxObjectPtr object ){};
541 };
542 
543 
544 
545 
547 {
548 
549  void import( OdRxObjectPtr object ){};
550 
551 };
552 
553 
555 {
556 
557  void import( OdRxObjectPtr object ){};
558 
559 };
560 
561 
563 {
564  void import( OdRxObjectPtr object ){};
565 };
566 
567 
569 {
570 
571  void import( OdRxObjectPtr object ){};
572 
573 };
574 
575 
577 {
578 
579  void import( OdRxObjectPtr object ){};
580 
581 };
582 
583 
585 {
586 
587  void import( OdRxObjectPtr object ){};
588 
589 };
590 
591 
593 {
594 
595  void import( OdRxObjectPtr object ){};
596 
597 
598 };
599 
600 
602 {
603 
604  void import( OdRxObjectPtr object ){};
605 
606 };
607 
608 
610 {
611 
612  void import( OdRxObjectPtr object ){};
613 
614 };
615 
616 
618 {
619 
620  void import( OdRxObjectPtr object ){};
621 
622 };
623 
624 
626 {
627  void import( OdRxObjectPtr object ){};
628 
629 };
630 
631 
633 {
634 
635  void import( OdRxObjectPtr object ){};
636 
637 };
638 
639 
640 class TagElement : public HDGNImporter
641 {
642 
643  void import( OdRxObjectPtr object ){};
644 
645 
646 };
647 
648 
650 {
651 
652  void import( OdRxObjectPtr object );
653 };
654 
655 
657 {
658  void import( OdRxObjectPtr object );
659 };
660 
661 class LevelTable : public HDGNImporter
662 {
663 
664  void import( OdRxObjectPtr object ){};
665 
666 };
667 
668 
670 {
671 
672  void import( OdRxObjectPtr object ){};
673 
674 };
675 
676 
677 class FontTable : public HDGNImporter
678 {
679 
680  void import( OdRxObjectPtr object ){};
681 
682 };
683 
684 
686 {
687  void import( OdRxObjectPtr object ){};
688 
689 };
690 
691 
693 {
694 
695  void import( OdRxObjectPtr object ){};
696 
697 };
698 
699 
701 {
702  void import( OdRxObjectPtr object ){};
703 
704 };
705 
706 
708 {
709 
710  void import( OdRxObjectPtr object ){};
711 
712 
713 };
714 
715 
717 {
718  void import( OdRxObjectPtr object ){};
719 
720 };
721 
722 
724 {
725 
726  void import( OdRxObjectPtr object ){};
727 
728 };
729 
730 
732 {
733 
734  void import( OdRxObjectPtr object ){};
735 
736 
737 };
738 
739 
741 {
742 
743  void import( OdRxObjectPtr object ){};
744 
745 
746 };
747 
748 
750 {
751 
752  void import( OdRxObjectPtr object ){};
753 
754 
755 };
756 
757 
758 class RegAppTable : public HDGNImporter
759 {
760 
761  void import( OdRxObjectPtr object ){};
762 
763 };
764 
765 
767 {
768 
769  void import( OdRxObjectPtr object ){};
770 
771 };
772 
773 
774 class ViewTable : public HDGNImporter
775 {
776 
777  void import( OdRxObjectPtr object ){};
778 
779 };
780 
781 
782 class View : public HDGNImporter
783 {
784  void import( OdRxObjectPtr object );
785 
786 };
787 
789 {
790  void import( OdRxObjectPtr object );
791 };
792 
793 class ViewGroup : public HDGNImporter
794 {
795 
796  void import( OdRxObjectPtr object );
797 };
798 
800 {
801  void import( OdRxObjectPtr object ){};
802 
803 };
804 
805 
807 {
808 
809  void import( OdRxObjectPtr object );
810 
811 };
812 
813 
815 {
816 
817  void import( OdRxObjectPtr object );
818 
819 
820 };
821 
823 {
824 public:
826  {
827  m_iSharedCellRefCounter = 0;
828  m_bSharedCellDefTable = false;
829  };
830 
831 private:
832  int m_iSharedCellRefCounter;
833  bool m_bSharedCellDefTable;
834  void import( OdRxObjectPtr object );
835 };
836 
837 
839 {
840  void import( OdRxObjectPtr object ){};
841 
842 };
843 
844 
846 {
847  void import( OdRxObjectPtr object ){};
848 
849 };
850 
851 
853 {
854  void import( OdRxObjectPtr object ){};
855 
856 };
857 
859 {
860  void import( OdRxObjectPtr object ){};
861 
862 };
863 
865 {
866  void import( OdRxObjectPtr object ){};
867 
868 };
869 
870 
871 class ColorTable : public HDGNImporter
872 {
873  void import( OdRxObjectPtr object ){};
874 
875 };
876 
877 class Mesh : public HDGNImporter
878 {
879  void import( OdRxObjectPtr object );
880 
881 };
882 
883 //worlddraw() callback classes
884 
885 class HOdExDgnSystemServices : public OdExDgnSystemServices,
886  public OdExDgnHostAppServices
887 {
888  ODRX_USING_HEAP_OPERATORS(OdExDgnSystemServices);
889 };
890 
891 extern OdStaticRxObject< HOdExDgnSystemServices > g_HIO_OdExDgnSystemServices ;
892 
893 //worldDraw() class
894 class sampleTraits : public OdStaticRxObject<OdGiSubEntityTraits>
895 {
896  //ODRX_DECLARE_MEMBERS(OdGiSubEntityTraits);
897 
898  virtual void setColor(OdUInt16 color) {}
899 
900  virtual void setTrueColor(const OdCmEntityColor& cmColor) {}
901 
902  virtual void setLayer(OdDbStub* layerId) {}
903 
904  virtual void setLineType(OdDbStub* linetypeId) {}
905 
906  virtual void setSelectionMarker(OdGsMarker markerId) {}
907 
908  virtual void setFillType(OdGiFillType fillType) {}
909 
910  virtual void setFillPlane(const OdGeVector3d* /*pNormal*/ = 0) {}
911 
912  virtual void setLineWeight(OdDb::LineWeight lw) {}
913 
914  virtual void setLineTypeScale(double dScale = 1.0) {}
915 
916  virtual void setLineTypeScaleToFit(bool /*doIt*/) /*= 0*/ {};
917 
918  virtual void setThickness(double dThickness) {}
919 
920  virtual void setPlotStyleName(OdDb::PlotStyleNameType, OdDbStub* = 0) {}
921 
922  virtual void setMaterial(OdDbStub* /*materialId*/) {}
923 
924  virtual void setMapper(const OdGiMapper * /*pMapper*/) {}
925 
926  virtual void setVisualStyle(const OdDbStub* /*visualStyleId*/) {}
927 
928  virtual OdUInt16 color() const { return 0; }
929 
930  virtual OdCmEntityColor trueColor() const { return OdCmEntityColor(); }
931 
932  virtual OdDbStub* layer() const { return 0; }
933 
934  virtual OdDbStub* lineType() const { return 0; }
935 
936  virtual OdGiFillType fillType() const { return kOdGiFillAlways; }
937 
938  virtual bool fillPlane(OdGeVector3d& /*normal*/) { return false; }
939 
940  virtual OdDb::LineWeight lineWeight() const { return OdDb::kLnWtByLwDefault; }
941 
942  virtual double lineTypeScale() const { return 0.; }
943 
944  virtual double thickness() const { return 0.; }
945 
946  virtual OdDb::PlotStyleNameType plotStyleNameType() const { return OdDb::kPlotStyleNameByLayer; }
947 
948  virtual OdDbStub* plotStyleNameId() const { return 0; }
949 
950  virtual OdDbStub* material() const { return 0; }
951 
952  virtual const OdGiMapper* mapper() const { return 0; }
953 
954  virtual OdDbStub* visualStyle() const { return 0; }
955 
956  virtual void addLight(const OdDbStub* lightId){}
957 
958 };
959 
960 //worldDraw() class
962 {
963 public:
964 
965  OdGePoint3dArray pnts;
966  OdInt32Array faces;
967 
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)
969  {
970  pnts.resize(numVertices);
971  memcpy(pnts.asArrayPtr(), vertexList, sizeof(OdGePoint3d)*numVertices);
972  faces.resize(faceListSize);
973  memcpy(faces.asArrayPtr(), faceList, sizeof(OdInt32)*faceListSize);
974  }
975 };
976 
977 //worldDraw() class
978 template<class T>
979 class OdGiGeometry_ : public T
980 {
981 
982 public:
983  OdArray<shellStore> &m_WireCache;
984 
985  shellStore *appendWire()
986  {
987  shellStore *pWire = m_WireCache.append();
988  return pWire;
989  }
990 
991  OdGiGeometry_(OdArray<shellStore> &pWireCache)
992  : m_WireCache(pWireCache)
993  {
994  }
995 
996  virtual void pline(const OdGiPolyline& pline , OdUInt32 n1 , OdUInt32 n2 );
997 
998 
999  virtual OdGeMatrix3d getModelToWorldTransform() const
1000  {
1001  return OdGeMatrix3d();
1002  };
1003  virtual OdGeMatrix3d getWorldToModelTransform() const
1004  {
1005  return OdGeMatrix3d();
1006  };
1007 
1008  virtual void pushModelTransform(const OdGeVector3d& vNormal){};
1009 
1010  virtual void pushModelTransform(const OdGeMatrix3d& xMat);
1011 
1012  virtual void popModelTransform(){};
1013 
1014 
1015  // For drawing various primitives.
1016  //
1017  virtual void circle(const OdGePoint3d& center, double radius, const OdGeVector3d& normal);
1018 
1019  virtual void circle(const OdGePoint3d& p1, const OdGePoint3d& p2, const OdGePoint3d& p3);
1020 
1021  virtual void circularArc(const OdGePoint3d& center,double radius,
1022  const OdGeVector3d& normal,const OdGeVector3d& startVector,
1023  double sweepAngle,OdGiArcType arcType = kOdGiArcSimple);
1024 
1025 
1026  virtual void circularArc(const OdGePoint3d& start,const OdGePoint3d& point,
1027  const OdGePoint3d& end,OdGiArcType arcType = kOdGiArcSimple);
1028 
1029 
1030  virtual void polyline(OdInt32 nbPoints,const OdGePoint3d* pVertexList,
1031  const OdGeVector3d* pNormal = NULL,OdGsMarker lBaseSubEntMarker = -1) ;
1032 
1033 
1034  virtual void polygon(OdInt32 nbPoints, const OdGePoint3d* pVertexList);
1035 
1036 
1037  virtual void mesh(OdInt32 rows,
1038  OdInt32 columns,
1039  const OdGePoint3d* pVertexList,
1040  const OdGiEdgeData* pEdgeData = NULL,
1041  const OdGiFaceData* pFaceData = NULL,
1042  const OdGiVertexData* pVertexData = NULL);
1043 
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 );
1051 
1052  virtual void text(const OdGePoint3d& position,
1053  const OdGeVector3d& normal, const OdGeVector3d& direction,
1054  double height, double width, double oblique, const OdString& msg);
1055 
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);
1059 
1060 
1061  void ray(const OdGePoint3d& first, const OdGePoint3d& second);
1062 
1063  virtual void nurbs(const OdGeNurbCurve3d& nurbs){};
1064 
1065  virtual void xline(const OdGePoint3d& p1, const OdGePoint3d& p2);
1066 
1067  virtual void ellipArc(const OdGeEllipArc3d& arc,
1068  const OdGePoint3d* pEndPointsOverrides = 0,
1069  OdGiArcType arcType = kOdGiArcSimple);
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: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:609
Definition: HDGNHelper.h:788
Definition: HDGNHelper.h:822
Definition: HDGNHelper.h:656
Definition: HDGNHelper.h:142
Definition: HDGNHelper.h:766
HInputHandler an abstract base class for model and image input.
Definition: HIOManager.h:667
Definition: HDGNHelper.h:677
#define HC_KEY
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:625
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:649
Definition: HDGNHelper.h:885
Definition: HDGNHelper.h:450
Definition: HDGNHelper.h:782
Definition: HIOManager.h:247
Definition: HDGNHelper.h:845
Definition: HDGNHelper.h:355
Definition: HDGNHelper.h:700
Definition: HDGNHelper.h:437
Definition: HDGNHelper.h:617
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