zjf
2023-03-10 abac8765bf6a1f400c2377b9999ce7495ba34a3f
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
/////////////////////////////////////////////////////////////////////////////// 
// Copyright (C) 2002-2016, Open Design Alliance (the "Alliance"). 
// All rights reserved. 
// 
// This software and its documentation and related materials are owned by 
// the Alliance. The software may only be incorporated into application 
// programs owned by members of the Alliance, subject to a signed 
// Membership Agreement and Supplemental Software License Agreement with the
// Alliance. The structure and organization of this software are the valuable  
// trade secrets of the Alliance and its suppliers. The software is also 
// protected by copyright law and international treaty provisions. Application  
// programs incorporating this software must include the following statement 
// with their copyright notices:
//   
//   This application incorporates Teigha(R) software pursuant to a license 
//   agreement with Open Design Alliance.
//   Teigha(R) Copyright (C) 2002-2016 by Open Design Alliance. 
//   All rights reserved.
//
// By use of this software, its documentation or related materials, you 
// acknowledge and accept the above terms.
///////////////////////////////////////////////////////////////////////////////
 
#ifndef OD_VIEWBORDER_H
#define OD_VIEWBORDER_H
 
#include "DbEntity.h"
#include "ModelDocObjExports.h"
 
#include "TD_PackPush.h"
 
/** \details
    This class represents the border entity that is used by model documentation views and defines the region for placing the view on the layout.
 
    Library: AcModelDocObj
    <group OdModelDocObj_Classes> 
*/
class MODELDOCOBJ_EXPORT OdDbViewBorder : public OdDbEntity
{
  friend class OdDbAssocViewRepActionBody;
  friend class OdDbImpAssocViewRepActionBody;
  //friend class OdDbViewBorderImpl;
  //friend class OdDbViewSymbolImpl;
public:
  ODDB_DECLARE_MEMBERS(OdDbViewBorder);
 
  /** \details
    Default constructor. Creates an OdDbViewBorder instance.
  */
  OdDbViewBorder();
  virtual ~OdDbViewBorder();
 
 
  /** \details
    Defines view style types.
  */
  enum ViewStyleType 
  {
    kFromBase               = 0,  // The style defined by the base view.
    kWireframeVisibleEdges  = 1,  // Wireframe style with visible edges only.
    kWireframeHiddenEdges   = 2,  // Wireframe style with hidden edges displayed.
    kShadedVisibleEdges     = 3,  // Shaded style with visible edges only.
    kShadedHiddenEdges      = 4   // Shaded style with hidden edges displayed.
  };
 
  /** \details
    Defines the types of source data of the documentation view. Views can be created from model space or from external Autodesk Inventor or Inventor Fusion files. 
  */
  enum SourceType
  {
    kSourceNotDefined   = 0,  // Source type is not defined.
    kInventorSource     = 1,  // Source data is from an Autodesk Inventor file.
    kFusionSource       = 2,  // Source data is from an Autodesk Inventor Fusion file.
    kModelSpaceSource   = 3   // Source data is from model space.
  };
 
  /** \details
    Returns WCS coordinates of the center point of the view border entity in paper space. 
  */
  OdGePoint3d insertionPoint() const;
 
  /** \details
    Returns the height of the view border entity. 
  */
  double height() const;
 
  /** \details
    Returns the width of the view border entity. 
  */
  double width() const;
 
  /** \details
    Returns the source data type of the model documentation view as a SourceType enumeration value.
  */
  OdDbViewBorder::SourceType sourceType() const;
 
  /** \details
    Returns the full path to a referenced Autodesk Inventor file.
 
    \note
    Returns a String object that contains the full path to the Inventor file.
    If the view source type isn't SourceType::kInventorSource, the method returns an empty string.
  */
  OdString inventorFileReference() const;
 
  /** \details
    Returns true value if the projection type is the first angle and false otherwise.
  */
  bool isFirstAngleProjection() const;
 
  /** \details
    Returns the rotation angle of the model documentation view around the line of sight 
    (vector perpendicular to the display, going from the front of display toward the back). 
    Zero angle is on the X-axis of the display coordinate system, and positive direction of rotation is counterclockwise.
 
    \note
    Returns the view's rotation angle in radians as a double value.
  */
  double rotationAngle() const;
 
 
  /** \details
    Returns the view style type as a ViewStyleType enumeration value.
  */
  OdDbViewBorder::ViewStyleType viewStyleType() const;
 
  /** \details
    Returns the scale factor of the model documentation view. 
    The scale factor defines a ratio between paper space units and viewport units in model space.
    For example, if the scale factor is 2 that means 1 unit of the viewport maps to 2 units in paper space.  
  */
  double scale() const;
 
  /** \details
    Returns the DPI value for the views with the shaded view styles (ViewStyleType::kShadedVisibleEdges, ViewStyleType::kShadedHiddenEdges).  
  */
  OdUInt32 shadedDPI() const;
 
  /** \details
    Returns ObjectId of the associated OdDbViewport object.  
  */
  OdDbObjectId viewportId() const;
  OdResult setViewportId(const OdDbObjectId& viewportId);
 
protected:
  // OdGiDrawable methods :
  virtual bool subWorldDraw(OdGiWorldDraw* pWd) const;
  virtual void subHighlight(bool bDoIt = true, const OdDbFullSubentPath* pSubId = 0, bool highlightAll = false) const;
 
  //// OdDbObject methods :
  //virtual OdResult subErase(bool erasing);
  //virtual OdResult subDeepClone(OdDbObject* pOwnerObject, OdDbObject*& pClonedObject, 
  //                              OdDbIdMapping& idMap, bool isPrimary = true) const;
  //virtual OdResult subWblockClone(OdRxObject* pOwnerObject, OdDbObject*& pClonedObject, 
  //                                OdDbIdMapping& idMap, bool isPrimary = true) const;
 
  virtual OdResult dwgInFields(OdDbDwgFiler* pFiler);
  virtual void dwgOutFields(OdDbDwgFiler* pFiler) const;
  virtual OdResult dxfInFields(OdDbDxfFiler* pFiler);
  virtual void dxfOutFields(OdDbDxfFiler* pFiler) const;
 
public:
  //virtual void audit(OdDbAuditInfo* pAuditInfo);
 
  //virtual OdResult subGetStretchPoints(OdGePoint3dArray& stretchPoints) const;
  //virtual OdResult subMoveStretchPointsAt(const OdIntArray& indices, 
  //                                        const OdGeVector3d& offset);
 
  // OdDbEntity methods :
  //virtual OdResult subGetGripPoints(OdDbGripDataPtrArray& grips, 
  //                                  const double curViewUnitSize, 
  //                                  const int gripSize, 
  //                                  const OdGeVector3d& curViewDir, 
  //                                  const int bitflags) const;
  //virtual OdResult subGetGripPoints(OdGePoint3dArray& gripPoints, 
  //                                  OdIntArray& osnapModes, 
  //                                  OdIntArray& geomIds) const;
  //virtual OdResult subMoveGripPointsAt(const OdDbVoidPtrArray& gripAppData,
  //                                     const OdGeVector3d& offset, 
  //                                     const int bitflags);
  //virtual OdResult subMoveGripPointsAt(const OdIntArray& indices, 
  //                                     const OdGeVector3d& offset);
  //virtual void subGripStatus(const OdDb::GripStat status);
 
  //virtual OdResult subGetOsnapPoints(OdDb::OsnapMode osnapMode, 
  //                                   OdGsMarker gsSelectionMark, 
  //                                   const OdGePoint3d& pickPoint, 
  //                                   const OdGePoint3d& lastPoint, 
  //                                   const OdGeMatrix3d& viewXform, 
  //                                   OdGePoint3dArray& snapPoints, 
  //                                   OdIntArray& geomIds) const;
  //virtual OdResult subGetOsnapPoints(OdDb::OsnapMode osnapMode, 
  //                                   OdGsMarker gsSelectionMark, 
  //                                   const OdGePoint3d& pickPoint, 
  //                                   const OdGePoint3d& lastPoint, 
  //                                   const OdGeMatrix3d& viewXform, 
  //                                   OdGePoint3dArray& snapPoints, 
  //                                   OdIntArray& geomIds, 
  //                                   const OdGeMatrix3d& insertionMat) const;
 
  //virtual OdResult subIntersectWith(const OdDbEntity* pEnt, 
  //                                  OdDb::Intersect intType, 
  //                                  const OdGePlane& projPlane, 
  //                                  OdGePoint3dArray& points, 
  //                                  OdGsMarker thisGsMarker = 0, 
  //                                  OdGsMarker otherGsMarker = 0) const;
 
  //virtual OdResult subIntersectWith(const OdDbEntity* pEnt, 
  //                                  OdDb::Intersect intType, 
  //                                  OdGePoint3dArray& points, 
  //                                  OdGsMarker thisGsMarker = 0, 
  //                                  OdGsMarker otherGsMarker = 0) const;
 
  virtual OdResult subTransformBy(const OdGeMatrix3d& xform);
 
  //virtual OdResult subGetClassID(CLSID* pClsid) const;
 
  //virtual void subList() const;
 
  //virtual void subHighlight(bool bDoIt = true, 
  //                          const OdDbFullSubentPath* pSubId = 0, 
  //                          bool highlightAll = false) const;
 
  //virtual  OdResult  subGetSubentPathsAtGsMarker(OdDb::SubentType type,
  //                                               OdGsMarker gsMark, 
  //                                               const OdGePoint3d& pickPoint,
  //                                               const OdGeMatrix3d& viewXform, 
  //                                               int& numPaths,
  //                                               OdDbFullSubentPath*& subentPaths, 
  //                                               int numInserts = 0,
  //                                               OdDbObjectId* entAndInsertStack = NULL) const;
 
  //virtual  OdResult  subGetGsMarkersAtSubentPath(const OdDbFullSubentPath* pSubPath, 
  //                                               OdArray<OdGsMarker>& gsMarkers) const;
 
  //virtual  OdResult  subGetSubentClassId(const OdDbFullSubentPath* pSubPath, CLSID* clsId) const;
 
  //virtual void saveAs(OdGiWorldDraw* mode, OdDb::SaveType st);
 
  //virtual OdResult setLayer(const OdString& newVal,
  //                          bool doSubents = true,
  //                          bool allowHiddenLayer = false);
  //virtual OdResult setLayer(OdDbObjectId newVal,
  //                          bool doSubents = true,
  //                          bool allowHiddenLayer = false);
 
public:
  // Internal use only methods:
  //OdResult setViewportId(const OdDbObjectId& viewportId);
  OdGePoint2d centerPoint(bool exludeSketchEnts = true) const;
  OdGePoint3d centerPoint3d(bool exludeSketchEnts = true) const;
  OdResult getSize(OdGePoint3d& minPt, OdGePoint3d& maxPt) const;
  OdResult setSize(const OdGePoint3d& minPt, const OdGePoint3d& maxPt);
  void setScale(double newScale);
  //OdResult recalculateBorder();
 
  //void setTransientEnts(const OdArray<OdDbEntity*>& traientEnts);
  //void setDisableUnHighlight(bool bIsDisable);
  //bool hitTest(const OdGePoint3d& inputPt) const;
 
  // Internal use only methods: subentity related methods
  //OdResult getSubentColor(const OdDbSubentId& subentId, OdCmColor& color) const;
  //OdResult setSubentColor(const OdDbSubentId& subentId, const OdCmColor& color);
 
  //OdResult getSubentLayerId(const OdDbSubentId& subentId, OdDbObjectId& layerId) const;
  //OdResult setSubentLayer(const OdDbSubentId& subentId, OdDbObjectId newVal);
 
  //OdResult getSubentLinetypeId(const OdDbSubentId& subentId, OdDbObjectId& linetypeId) const;
  //OdResult setSubentLinetype(const OdDbSubentId& subentId, OdDbObjectId newVal);
 
  //OdResult getSubentLinetypeScale(const OdDbSubentId& subentId, double& linetypeScale) const;
  //OdResult setSubentLinetypeScale(const OdDbSubentId& subentId, double newVal);
 
  //const OdString& getSubentPlotStyleName(const OdDbSubentId& subentId) const;
  //OdResult setSubentPlotStyleName(const OdDbSubentId& subentId, const OdString& newName);
 
  //OdResult getSubentLineWeight(const OdDbSubentId& subentId, OdDb::LineWeight& lineweight) const;
  //OdResult setSubentLineWeight(const OdDbSubentId& subentId, OdDb::LineWeight newVal);
 
  //OdResult getSubentVisibility(const OdDbSubentId& subentId, OdDb::Visibility& visVal) const;
  //OdResult setSubentVisibility(const OdDbSubentId& subentId, OdDb::Visibility newVal);
 
  //OdResult subentIdToNestedEnts(const OdDbSubentId& subentId, OdDbFullSubentPathArray &nestedEnts) const;
 
 protected:
 
  OdDbObjectId getScaleId() const;
  void setScaleId( const OdDbObjectId scaleId );
 
//private:
//  OdGeMatrix3d transientXform() const;
 
//private:
//  static  double sViewBoderOffset;
};
 
/** \details
  This template class is a specialization of the OdSmartPtr class for OdDbViewBorder object pointers.
*/
typedef OdSmartPtr<OdDbViewBorder> OdDbViewBorderPtr;
 
#include "TD_PackPop.h"
 
#endif // OD_VIEWBORDER_H