CFx SDK Documentation  2020SP3
DbModelDocViewStyle.h
Go to the documentation of this file.
1 // Copyright (C) 2002-2017, Open Design Alliance (the "Alliance").
3 // All rights reserved.
4 //
5 // This software and its documentation and related materials are owned by
6 // the Alliance. The software may only be incorporated into application
7 // programs owned by members of the Alliance, subject to a signed
8 // Membership Agreement and Supplemental Software License Agreement with the
9 // Alliance. The structure and organization of this software are the valuable
10 // trade secrets of the Alliance and its suppliers. The software is also
11 // protected by copyright law and international treaty provisions. Application
12 // programs incorporating this software must include the following statement
13 // with their copyright notices:
14 //
15 // This application incorporates Teigha(R) software pursuant to a license
16 // agreement with Open Design Alliance.
17 // Teigha(R) Copyright (C) 2002-2017 by Open Design Alliance.
18 // All rights reserved.
19 //
20 // By use of this software, its documentation or related materials, you
21 // acknowledge and accept the above terms.
23 
24 #ifndef OD_MODELDOCVIEWSTYLE_H
25 #define OD_MODELDOCVIEWSTYLE_H
26 
27 #include "TD_PackPush.h"
28 #include "DbObject.h"
29 
36 {
37 protected:
38  // Default constructor is protected since OdDbModelDocViewStyle is an abstract class.
40 
41 public:
43 
48  kAboveView = 0, // Label text is attached above the view.
49  kBelowView = 1, // Label text is attached below the view.
50  };
51 
56  kTextAlignmentLeft = 0, // Left alignment is used for the view label text.
57  kTextAlignmentCenter = 1, // Center alignment is used for the view label text.
58  kTextAlignmentRight = 2, // Right alignment is used for the view label text.
59  };
60 
61  // Default destructor.
62  virtual ~OdDbModelDocViewStyle() = 0;
63 
67  virtual OdString getName() const;
68 
74  virtual void setName(const OdString& name);
75 
79  virtual OdString description() const;
80 
86  virtual void setDescription(const OdString& description);
87 
91  virtual void setDatabaseDefaults(OdDbDatabase* pDb);
92 
103  const OdString& styleName) = 0;
104 
112 
119 
128  bool isViewNameValid(const OdString& name) const;
129 
131  // Calculates a view label's position.
132  //
133  // \param offsetVector [out] Offset (vector) of the view label.
134  // \param textAlignment [out] Text alignment of the view label.
135  // \param attachment [in] Use with the offset argument to specify label position.
136  // \param offset [in] Use with the attachment argument to specify label position.
137  // \param minPt [in] Point located in the lower left corner of the view's bounding box.
138  // \param maxPt [in] Point located in the upper right corner of the view's bounding box.
139  //
140  // \returns
141  // Position of the view label.
142  //*/
143  //static OdGePoint3d calculateViewLabelPosition(OdGeVector2d& offsetVector,
144  // OdDbMText::AttachmentPoint& textAlignment,
145  // OdDbModelDocViewStyle::AttachmentPoint attachment,
146  // double offset,
147  // const OdGePoint3d& minPt,
148  // const OdGePoint3d& maxPt);
149 
151  // Sets the position of a view label.
152  //
153  // \param pMText [in] Pointer to MText object to be positioned as a label.
154  // \param attachment [in] Use with the offset argument to specify label position.
155  // \param offset [in] Use with the attachment argument to specify label position.
156  // \param minPt [in] Point located in the lower left corner of the view's bounding box.
157  // \param maxPt [in] Point located in the upper right corner of the view's bounding box.
158  //
159  // \returns
160  // Position of the view label.
161  //*/
162  //static OdGeVector2d setViewLabelPosition(OdDbMText* pMText,
163  // OdDbModelDocViewStyle::AttachmentPoint attachment,
164  // double offset,
165  // const OdGePoint3d& minPt,
166  // const OdGePoint3d& maxPt);
167 
169  // Updates the position of a view label.
170  //
171  // \param pMText [in] Pointer to MText object to be positioned as a label.
172  // \param attachment [in] Specifies whether the label is attached.
173  // \param minPt [in] Point located in the lower left corner of the view's bounding box.
174  // \param maxPt [in] Point located in the upper right corner of the view's bounding box.
175  //
176  // \returns
177  // Position of the view label.
178  //*/
179  //static OdGeVector2d updateViewLabelPosition(OdDbMText* pMText,
180  // OdDbModelDocViewStyle::AttachmentPoint attachment,
181  // const OdGePoint3d& minPt,
182  // const OdGePoint3d& maxPt);
183 
186  bool canRename() const;
187  OdResult setCanRename(bool canRename);
188 
189 protected:
190  // OdDbObject overridden functions
192  virtual void dwgOutFields(OdDbDwgFiler* pFiler) const;
194  virtual void dxfOutFields(OdDbDxfFiler* pFiler) const;
195 
196  enum
197  {
198  kCanRename = 1
199  };
200 
201 //protected:
202 // // For internal use only
203 // virtual OdDbObjectPtr subDeepClone(OdDbObject* pOwner,
204 // OdDbIdMapping& idMap, bool isPrimary = true) const;
205 // virtual OdDbObjectPtr subWblockClone(OdDbObject* pOwner,
206 // OdDbIdMapping& idMap, bool isPrimary = true) const;
207 //private:
208 // friend class OdDbModelDocViewStyleImp;
209 };
210 
215 
216 #include "TD_PackPop.h"
217 
218 #endif // OD_MODELDOCVIEWSTYLE_H
OdDbModelDocViewStyle::isViewNameValid
bool isViewNameValid(const OdString &name) const
OdResult
OdResult
Definition: OdResult.h:29
OdString
Definition: OdString.h:95
OdDbDatabase
Definition: DbDatabase.h:421
OdDbModelDocViewStyle::description
virtual OdString description() const
OdDbModelDocViewStyle::~OdDbModelDocViewStyle
virtual ~OdDbModelDocViewStyle()=0
OdDbModelDocViewStyle::SetDispayName
OdResult SetDispayName(const OdString &name)
name
GLuint const GLchar * name
Definition: gles2_ext.h:265
OdDbModelDocViewStyle::dwgInFields
virtual OdResult dwgInFields(OdDbDwgFiler *pFiler)
DbObject.h
OdDbObjectId
Definition: DbObjectId.h:99
TD_PackPop.h
OdDbModelDocViewStyle
Definition: DbModelDocViewStyle.h:36
OdDbModelDocViewStyle::postViewStyleToDb
virtual OdDbObjectId postViewStyleToDb(OdDbDatabase *pDb, const OdString &styleName)=0
OdDbModelDocViewStyle::setCanRename
OdResult setCanRename(bool canRename)
index
GLuint index
Definition: gles2_ext.h:265
OdDbModelDocViewStyle::dxfOutFields
virtual void dxfOutFields(OdDbDxfFiler *pFiler) const
OdDbModelDocViewStyle::TextAlignment
TextAlignment
Definition: DbModelDocViewStyle.h:55
OdSmartPtr
Definition: SmartPtr.h:58
OdDbModelDocViewStyle::OdDbModelDocViewStyle
OdDbModelDocViewStyle()
OdDbModelDocViewStyle::AttachmentPoint
AttachmentPoint
Definition: DbModelDocViewStyle.h:47
OdDbModelDocViewStyle::isModifiedForRecompute
bool isModifiedForRecompute() const
OdDbDxfFiler
Definition: DbFiler.h:194
OdDbModelDocViewStyle::dxfInFields
virtual OdResult dxfInFields(OdDbDxfFiler *pFiler)
OdDbModelDocViewStyle::getDisplayName
OdString getDisplayName() const
‍**
TD_PackPush.h
OdDbModelDocViewStylePtr
OdSmartPtr< OdDbModelDocViewStyle > OdDbModelDocViewStylePtr
Definition: DbModelDocViewStyle.h:214
ODRX_ABSTRACT
#define ODRX_ABSTRACT
Definition: OdPlatformSettings.h:117
OdDbModelDocViewStyle::canRename
bool canRename() const
OdDbModelDocViewStyle::setDatabaseDefaults
virtual void setDatabaseDefaults(OdDbDatabase *pDb)
OdDbModelDocViewStyle::ODDB_DECLARE_MEMBERS
ODDB_DECLARE_MEMBERS(OdDbModelDocViewStyle)
OdDbModelDocViewStyle::defaultViewName
OdString defaultViewName(int index) const
OdDbModelDocViewStyle::dwgOutFields
virtual void dwgOutFields(OdDbDwgFiler *pFiler) const
OdDbModelDocViewStyle::setDescription
virtual void setDescription(const OdString &description)
OdDbModelDocViewStyle::getName
virtual OdString getName() const
TOOLKIT_EXPORT
#define TOOLKIT_EXPORT
Definition: DbExport.h:40
OdDbModelDocViewStyle::setName
virtual void setName(const OdString &name)
OdDbObject
Definition: DbObject.h:211
OdDbDwgFiler
Definition: DbFiler.h:1031