dbViewBorder.h 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226
  1. //////////////////////////////////////////////////////////////////////////////
  2. //
  3. // Copyright 2015 Autodesk, Inc. All rights reserved.
  4. //
  5. // Use of this software is subject to the terms of the Autodesk license
  6. // agreement provided at the time of installation or download, or which
  7. // otherwise accompanies this software in either electronic or hard copy form.
  8. //
  9. //////////////////////////////////////////////////////////////////////////////
  10. //
  11. #pragma once
  12. #pragma pack (push, 8)
  13. #ifndef ACSYNERGY_PORT
  14. #define ACSYNERGY_PORT
  15. #endif
  16. class AcDbImpViewBorder;
  17. class ACSYNERGY_PORT AcDbViewBorder : public AcDbEntity
  18. {
  19. friend class AcDbAssocViewRepActionBody;
  20. friend class AcDbImpViewBorder;
  21. friend class AcDbImpViewSymbol;
  22. public:
  23. ACRX_DECLARE_MEMBERS(AcDbViewBorder);
  24. /// <summary>
  25. /// Default constructor.
  26. /// </summary>
  27. ///
  28. /// <remarks>
  29. /// For internal use only.
  30. /// </remarks>
  31. ///
  32. AcDbViewBorder();
  33. /// <summary>
  34. /// Destructor.
  35. /// </summary>
  36. ///
  37. virtual ~AcDbViewBorder();
  38. enum ViewStyleType
  39. {
  40. kFromBase = 0,
  41. kWireframeVisibleEdges = 1,
  42. kWireframeHiddenEdges = 2,
  43. kShadedVisibleEdges = 3,
  44. kShadedHiddenEdges = 4
  45. };
  46. enum SourceType
  47. {
  48. kSourceNotDefined = 0,
  49. kInventorSource = 1,
  50. kFusionSource = 2,
  51. kModelSpaceSource = 3
  52. };
  53. AcGePoint3d insertionPoint() const;
  54. double height() const;
  55. double width() const;
  56. AcDbViewBorder::SourceType sourceType() const;
  57. AcString inventorFileReference() const;
  58. bool isFirstAngleProjection() const;
  59. double rotationAngle() const;
  60. AcDbViewBorder::ViewStyleType viewStyleType() const;
  61. double scale() const;
  62. Adesk::UInt32 shadedDPI() const;
  63. AcDbObjectId viewportId() const;
  64. // AcGiDrawable protocols
  65. virtual Adesk::Boolean subWorldDraw(AcGiWorldDraw* pWd);
  66. // AcDbObject protocols
  67. virtual Acad::ErrorStatus subErase(Adesk::Boolean erasing);
  68. virtual Acad::ErrorStatus subDeepClone(AcDbObject* pOwnerObject, AcDbObject*& pClonedObject,
  69. AcDbIdMapping& idMap, Adesk::Boolean isPrimary = true) const;
  70. virtual Acad::ErrorStatus subWblockClone(AcRxObject* pOwnerObject, AcDbObject*& pClonedObject,
  71. AcDbIdMapping& idMap, Adesk::Boolean isPrimary = true) const;
  72. virtual Acad::ErrorStatus dwgOutFields(AcDbDwgFiler* pFiler) const;
  73. virtual Acad::ErrorStatus dwgInFields(AcDbDwgFiler* pFiler);
  74. virtual Acad::ErrorStatus dxfOutFields(AcDbDxfFiler* pFiler) const;
  75. virtual Acad::ErrorStatus dxfInFields(AcDbDxfFiler* pFiler);
  76. virtual Acad::ErrorStatus audit(AcDbAuditInfo* pAuditInfo);
  77. virtual Acad::ErrorStatus subGetStretchPoints(AcGePoint3dArray& stretchPoints) const;
  78. virtual Acad::ErrorStatus subMoveStretchPointsAt(const AcDbIntArray & indices,
  79. const AcGeVector3d& offset);
  80. // AcDbEntity protocols
  81. virtual Acad::ErrorStatus subGetGripPoints(AcDbGripDataPtrArray& grips,
  82. const double curViewUnitSize,
  83. const int gripSize,
  84. const AcGeVector3d& curViewDir,
  85. const int bitflags) const;
  86. virtual Acad::ErrorStatus subGetGripPoints(AcGePoint3dArray& gripPoints,
  87. AcDbIntArray & osnapModes,
  88. AcDbIntArray & geomIds) const;
  89. virtual Acad::ErrorStatus subMoveGripPointsAt(const AcDbVoidPtrArray& gripAppData,
  90. const AcGeVector3d& offset,
  91. const int bitflags);
  92. virtual Acad::ErrorStatus subMoveGripPointsAt(const AcDbIntArray & indices,
  93. const AcGeVector3d& offset);
  94. virtual void subGripStatus(const AcDb::GripStat status);
  95. virtual Acad::ErrorStatus subGetOsnapPoints(AcDb::OsnapMode osnapMode,
  96. Adesk::GsMarker gsSelectionMark,
  97. const AcGePoint3d& pickPoint,
  98. const AcGePoint3d& lastPoint,
  99. const AcGeMatrix3d& viewXform,
  100. AcGePoint3dArray& snapPoints,
  101. AcDbIntArray & geomIds) const;
  102. virtual Acad::ErrorStatus subGetOsnapPoints(AcDb::OsnapMode osnapMode,
  103. Adesk::GsMarker gsSelectionMark,
  104. const AcGePoint3d& pickPoint,
  105. const AcGePoint3d& lastPoint,
  106. const AcGeMatrix3d& viewXform,
  107. AcGePoint3dArray& snapPoints,
  108. AcDbIntArray & geomIds,
  109. const AcGeMatrix3d& insertionMat) const;
  110. virtual Acad::ErrorStatus subIntersectWith(const AcDbEntity* pEnt,
  111. AcDb::Intersect intType,
  112. const AcGePlane& projPlane,
  113. AcGePoint3dArray& points,
  114. Adesk::GsMarker thisGsMarker = 0,
  115. Adesk::GsMarker otherGsMarker = 0) const;
  116. virtual Acad::ErrorStatus subIntersectWith(const AcDbEntity* pEnt,
  117. AcDb::Intersect intType,
  118. AcGePoint3dArray& points,
  119. Adesk::GsMarker thisGsMarker = 0,
  120. Adesk::GsMarker otherGsMarker = 0) const;
  121. virtual Acad::ErrorStatus subTransformBy(const AcGeMatrix3d& xform);
  122. virtual Acad::ErrorStatus subGetClassID(CLSID* pClsid) const;
  123. virtual void subList() const;
  124. virtual Acad::ErrorStatus subHighlight(const AcDbFullSubentPath& subId = kNullSubent,
  125. const Adesk::Boolean highlightAll = false) const;
  126. virtual Acad::ErrorStatus subUnhighlight(const AcDbFullSubentPath& subId = kNullSubent,
  127. const Adesk::Boolean highlightAll = false) const;
  128. virtual Acad::ErrorStatus subGetSubentPathsAtGsMarker(AcDb::SubentType type,
  129. Adesk::GsMarker gsMark,
  130. const AcGePoint3d& pickPoint,
  131. const AcGeMatrix3d& viewXform,
  132. int& numPaths,
  133. AcDbFullSubentPath*& subentPaths,
  134. int numInserts = 0,
  135. AcDbObjectId* entAndInsertStack
  136. = NULL) const;
  137. virtual Acad::ErrorStatus subGetGsMarkersAtSubentPath(const AcDbFullSubentPath& subPath,
  138. AcArray<Adesk::GsMarker>& gsMarkers) const;
  139. virtual Acad::ErrorStatus subGetSubentClassId(const AcDbFullSubentPath& path, CLSID* clsId) const;
  140. virtual void saveAs(AcGiWorldDraw* mode, AcDb::SaveType st);
  141. virtual Acad::ErrorStatus setLayer(const ACHAR* newVal,
  142. Adesk::Boolean doSubents = true,
  143. bool allowHiddenLayer = false);
  144. virtual Acad::ErrorStatus setLayer(AcDbObjectId newVal,
  145. Adesk::Boolean doSubents = true,
  146. bool allowHiddenLayer = false);
  147. // Internal use only methods
  148. Acad::ErrorStatus setViewportId(const AcDbObjectId& viewportId);
  149. AcGePoint2d centerPoint(bool exludeSketchEnts = true) const;
  150. AcGePoint3d centerPoint3d(bool exludeSketchEnts = true) const;
  151. Acad::ErrorStatus getSize(AcGePoint3d& minPt,
  152. AcGePoint3d& maxPt) const;
  153. Acad::ErrorStatus setSize(const AcGePoint3d& minPt,
  154. const AcGePoint3d& maxPt);
  155. void setScale(double newScale);
  156. Acad::ErrorStatus recalculateBorder();
  157. void setTransientEnts(const AcArray<AcDbEntity*>& traientEnts);
  158. void setDisableUnHighlight(bool bIsDisable);
  159. bool hitTest(const AcGePoint3d& inputPt) const;
  160. // Internal use only - subentity related methods
  161. Acad::ErrorStatus getSubentColor(const AcDbSubentId& subentId, AcCmColor& color) const;
  162. Acad::ErrorStatus setSubentColor(const AcDbSubentId& subentId, const AcCmColor& color);
  163. Acad::ErrorStatus getSubentLayerId(const AcDbSubentId& subentId, AcDbObjectId& layerId) const;
  164. Acad::ErrorStatus setSubentLayer(const AcDbSubentId& subentId, AcDbObjectId newVal);
  165. Acad::ErrorStatus getSubentLinetypeId(const AcDbSubentId& subentId, AcDbObjectId& linetypeId) const;
  166. Acad::ErrorStatus setSubentLinetype(const AcDbSubentId& subentId, AcDbObjectId newVal);
  167. Acad::ErrorStatus getSubentLinetypeScale(const AcDbSubentId& subentId, double& linetypeScale) const;
  168. Acad::ErrorStatus setSubentLinetypeScale(const AcDbSubentId& subentId, double newVal);
  169. ACHAR* getSubentPlotStyleName(const AcDbSubentId& subentId) const;
  170. Acad::ErrorStatus setSubentPlotStyleName(const AcDbSubentId& subentId, const ACHAR* newName);
  171. Acad::ErrorStatus getSubentLineWeight(const AcDbSubentId& subentId, AcDb::LineWeight& lineweight) const;
  172. Acad::ErrorStatus setSubentLineWeight(const AcDbSubentId& subentId, AcDb::LineWeight newVal);
  173. Acad::ErrorStatus getSubentVisibility(const AcDbSubentId& subentId, AcDb::Visibility& visVal) const;
  174. Acad::ErrorStatus setSubentVisibility(const AcDbSubentId& subentId, AcDb::Visibility newVal);
  175. Acad::ErrorStatus subentIdToNestedEnts (const AcDbSubentId& subentId, AcDbFullSubentPathArray &nestedEnts) const;
  176. private:
  177. AcGeMatrix3d transientXform() const;
  178. private:
  179. AcDbImpViewBorder* mpAcDbImpViewBorder;
  180. static double sViewBoderOffset;
  181. };
  182. #pragma pack (pop)