CFx SDK Documentation  2022 SP0
DbViewport.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_DB_VIEWPORT_
25 #define _OD_DB_VIEWPORT_
26 
27 #include "TD_PackPush.h"
28 
29 #include "DbEntity.h"
30 #include "DbSymbolTable.h"
31 #include "ViewportDefs.h"
32 #include "DbXrefObjectId.h"
33 
34 #include "Gi/GiViewportTraits.h"
35 
36 class OdGeExtents3d;
37 class OdGeMatrix3d;
38 class OdGsView;
39 class OdDbSun;
40 
49 {
50 protected:
51  /* void dxfOutXData(OdDbDxfFiler* pFiler) const;
52  */
53 public:
55 
57 
67  double height() const;
68 
79  void setHeight(
80  double height);
81 
91  double width() const;
92 
103  void setWidth(
104  double width);
105 
110 
116  const OdGePoint3d& centerPoint);
117 
123  OdInt16 number() const;
124 
128  bool isOn() const;
129 
133  void setOn();
134 
138  void setOff();
139 
144 
150  const OdGePoint3d& viewTarget);
151 
156 
162  const OdGeVector3d& viewDirection);
163 
167  double viewHeight() const;
168 
174  double viewHeight);
175 
180 
186  const OdGePoint2d& viewCenter);
187 
194  double twistAngle() const;
195 
203  double twistAngle);
204 
208  double lensLength() const;
209 
215  double lensLength);
216 
220  bool isFrontClipOn() const;
221 
226 
231 
235  bool isBackClipOn() const;
236 
241 
246 
252  bool isFrontClipAtEyeOn() const;
253 
260 
265 
269  double frontClipDistance() const;
270 
276  double frontClipDistance);
277 
281  double backClipDistance() const;
282 
288  double backClipDistance);
289 
293  bool isPerspectiveOn() const;
294 
299 
304 
308  bool isUcsFollowModeOn() const;
309 
314 
319 
323  bool isUcsIconVisible() const;
324 
329 
334 
338  bool isUcsIconAtOrigin() const;
339 
344 
349 
353  bool isFastZoomOn() const;
354 
359 
364 
371 
377  OdUInt16 circleSides);
378 
382  bool isSnapOn() const;
383 
387  void setSnapOn();
388 
392  void setSnapOff();
393 
397  bool isSnapIsometric() const;
398 
403 
408 
412  double snapAngle() const;
413 
421  double snapAngle);
422 
427 
433  const OdGePoint2d& snapBasePoint);
434 
439 
445  const OdGeVector2d& snapIncrement);
446 
460 
475  OdUInt16 snapIsoPair);
476 
480  bool isGridOn() const;
481 
485  void setGridOn();
486 
490  void setGridOff();
491 
496 
502  const OdGeVector2d& gridIncrement);
503 
507  bool hiddenLinesRemoved() const;
508 
513 
518 
528  const OdDbObjectIdArray& layerIds);
529 
539  const OdDbObjectIdArray& layerIds);
540 
545 
551  const OdDbObjectId& layerId) const;
552 
558  OdDbObjectIdArray& layerIds) const;
559 
569  void updateDisplay() const;
570 
571 
573  OdGiDrawableTraits* pTraits) const;
574 
575  virtual bool subWorldDraw(
576  OdGiWorldDraw* pWd) const;
577 
581  bool isLocked() const;
582 
586  void setLocked();
587 
591  void setUnlocked();
592 
596  bool isTransparent() const;
597 
602 
606  void setOpaque();
607 
609  {
610  kScaleToFit, // Scaled to Fit
611  kCustomScale, // Scale is not a standard scale
612  k1_1, // 1:1
613  k1_2, // 1:2
614  k1_4, // 1:4
615  k1_5, // 1:5
616  k1_8, // 1:8
617  k1_10, // 1:10
618  k1_16, // 1:16
619  k1_20, // 1:20
620  k1_30, // 1:30
621  k1_40, // 1:40
622  k1_50, // 1:50
623  k1_100, // 1:100
624  k2_1, // 2:1
625  k4_1, // 4:1
626  k8_1, // 8:1
627  k10_1, // 10:1
628  k100_1, // 100:1
629  k1_128in_1ft, // 1/128"= 1'
630  k1_64in_1ft, // 1/64"= 1'
631  k1_32in_1ft, // 1/32"= 1'
632  k1_16in_1ft, // 1/16"= 1'
633  k3_32in_1ft, // 3/32"= 1'
634  k1_8in_1ft, // 1/8" = 1'
635  k3_16in_1ft, // 3/16"= 1'
636  k1_4in_1ft, // 1/4" = 1'
637  k3_8in_1ft, // 3/8" = 1'
638  k1_2in_1ft, // 1/2" = 1'
639  k3_4in_1ft, // 3/4" = 1'
640  k1in_1ft, // 1" = 1'
641  k1and1_2in_1ft, // 1 1/2"= 1'
642  k3in_1ft, // 3" = 1'
643  k6in_1ft, // 6" = 1'
644  k1ft_1ft // 1' = 1'
645  };
646 
648  {
649  kAsDisplayed = 0, // As displayed
650  kWireframe = 1, // Wireframe
651  kHidden = 2, // Hidden
652  kRendered = 3, // Rendered
653  kVisualStyle = 4, // Visual style
654  kRenderPreset = 5 // Render preset
655  };
656 
660  double customScale() const;
661 
667  double customScale);
668 
673 
679  const StandardScaleType standardScale);
680 
685 
690 
695  const OdString& plotStyleSheetName);
696 
700  bool isNonRectClipOn() const;
701 
706 
711 
716 
739  OdDbObjectId clipEntityId);
740 
741  /*
742  virtual void erased(const OdDbObject* , bool);
743  virtual void modified(const OdDbObject *);
744  virtual void copied(const OdDbObject* pDbObj,const OdDbObject* pNewObj);
745  virtual void subObjModified(const OdDbObject* pDbObj, const OdDbObject* pSubObj);
746  */
747 
755  void getUcs(OdGePoint3d& origin,
756  OdGeVector3d& xAxis,
757  OdGeVector3d& yAxis) const;
758 
783  OdDb::OrthographicView& viewType,
784  const OdDbDatabase* pDb = 0) const;
785 
790 
797  double elevation() const;
798 
806  void setUcs(
807  const OdGePoint3d& origin,
808  const OdGeVector3d& xAxis,
809  const OdGeVector3d& yAxis);
810 
831  void setUcs(
832  OdDb::OrthographicView viewType, const OdDbDatabase* pDb = 0);
833 
839  void setUcs(
840  const OdDbObjectId& ucsId);
841 
846 
854  double elevation);
855 
856  /*
857  bool isViewOrthographic(OdDb::OrthographicView& view) const;
858 
859  void setViewDirection(OdDb::OrthographicView view);
860  */
861 
867 
875  bool ucsPerViewport);
876 
896  OdDb::RenderMode renderMode);
897 
917 
925 
934  const ShadePlotType shadePlot);
935 
936  // New in R21 functions
937 
939 
948  void setShadePlot(const ShadePlotType type, const OdDbObjectId& shadePlotId);
949 
950  bool plotWireframe() const;
951  bool plotAsRaster() const;
952 
954  void setBackground(const OdDbObjectId& backgroundId);
955 
956  // Visual Styles
957 
959  void setVisualStyle(const OdDbObjectId& visualStyle);
960 
961  // Viewport Lighting
962 
963  bool isDefaultLightingOn() const;
964  void setDefaultLightingOn(bool on);
967 
968  // Brightness controls the relative intensity of lights.
969 
970  double brightness() const;
971  void setBrightness(double);
972 
973  // Contrast controls intensity of ambient light, relative to other lights.
974 
975  double contrast() const;
976  void setContrast(double);
977 
979  void setAmbientLightColor(const OdCmColor& clr);
980 
981  // A single sun (distant light) can be associated with each viewport.
982 
985 
988 
991 
992  bool isGridBoundToLimits() const;
993  void setGridBoundToLimits(bool bNewVal);
994 
995  bool isGridAdaptive() const;
996  void setGridAdaptive(bool bNewVal);
997 
999  void setGridSubdivisionRestricted(bool bNewVal);
1000 
1001  bool isGridFollow() const;
1002  void setGridFollow(bool bNewVal);
1003 
1006 
1007  // View association methods
1008 
1009  void setModelView(const OdDbXrefObjectId &objId);
1013 
1014  void setSheetView(const OdDbObjectId &objId);
1017 
1018  void setLabelBlock(const OdDbObjectId objId);
1021 
1022  // OdGsView association methods
1023 
1024  OdGsView* gsView() const;
1026 
1027  // OdDbEntity overrides
1028 
1030  OdDbDatabase* pDb,
1031  bool doSubents);
1032 
1034  OdDbDwgFiler* pFiler);
1035 
1036  virtual void dwgOutFields(
1037  OdDbDwgFiler* pFiler) const;
1038 
1040  OdDbDxfFiler* pFiler);
1041 
1042  virtual void dxfOutFields(
1043  OdDbDxfFiler* pFiler) const;
1044 
1046  OdDbDxfFiler* pFiler);
1047 
1048  virtual void dxfOutFields_R12(
1049  OdDbDxfFiler* pFiler) const;
1050 
1052  void* pClsid) const;
1053 
1054  void subClose();
1055 
1057  bool erasing);
1058 
1063  void zoomExtents();
1064 
1066  OdGeExtents3d& extents) const;
1067 
1069  const OdGeMatrix3d& xfm) ODRX_OVERRIDE;
1070 
1071  void modified(const OdDbObject* pObj);
1072 
1073  void erased(const OdDbObject* pObj, bool pErasing);
1074 
1075  virtual OdResult subGetTransformedCopy(const OdGeMatrix3d& mat, OdDbEntityPtr& pCopy) const;
1076 
1077  virtual OdResult explodeGeometry(OdRxObjectPtrArray& entitySet) const;
1078 };
1079 
1084 
1085 #include "TD_PackPop.h"
1086 
1087 #endif
#define TOOLKIT_EXPORT
Definition: DbExport.h:40
OdSmartPtr< OdDbViewport > OdDbViewportPtr
Definition: DbViewport.h:1083
unsigned int OdUInt32
short OdInt16
unsigned short OdUInt16
#define ODRX_OVERRIDE
OdResult
Definition: OdResult.h:29
Definition: DbSun.h:40
bool plotAsRaster() const
void thawAllLayersInViewport()
void setUcs(const OdGePoint3d &origin, const OdGeVector3d &xAxis, const OdGeVector3d &yAxis)
void setShadePlot(const ShadePlotType shadePlot)
void setNonRectClipOff()
virtual void dwgOutFields(OdDbDwgFiler *pFiler) const
bool isLocked() const
virtual OdResult subTransformBy(const OdGeMatrix3d &xfm) ODRX_OVERRIDE
void setUcs(OdDb::OrthographicView viewType, const OdDbDatabase *pDb=0)
void setFrontClipDistance(double frontClipDistance)
void setUcsIconAtCorner()
void setCustomScale(double customScale)
virtual bool subWorldDraw(OdGiWorldDraw *pWd) const
bool isBackClipOn() const
void setGridOff()
bool isSnapIsometric() const
bool isUcsFollowModeOn() const
OdResult syncModelView()
void setPlotStyleSheet(const OdString &plotStyleSheetName)
virtual OdResult subGetClassID(void *pClsid) const
void setGridSubdivisionRestricted(bool bNewVal)
OdGsView * gsView() const
bool isFrontClipAtEyeOn() const
void setSnapStandard()
double width() const
double elevation() const
void removeLabelBlock()
OdGePoint2d viewCenter() const
void setWidth(double width)
double customScale() const
void setBackClipOff()
OdDbObjectId shadePlotId() const
void setBackClipOn()
void setUcsPerViewport(bool ucsPerViewport)
void setStandardScale(const StandardScaleType standardScale)
void setUnlocked()
OdDbObjectId nonRectClipEntityId() const
OdUInt16 snapIsoPair() const
OdDb::RenderMode renderMode() const
void setGridMajor(OdUInt16)
bool isUcsIconAtOrigin() const
void setSnapBasePoint(const OdGePoint2d &snapBasePoint)
bool isGridAdaptive() const
void setGsView(OdGsView *)
void setPerspectiveOff()
void setLabelBlock(const OdDbObjectId objId)
OdGeVector3d viewDirection() const
void setGridBoundToLimits(bool bNewVal)
void setUcsIconVisible()
void setGridAdaptive(bool bNewVal)
void setViewCenter(const OdGePoint2d &viewCenter)
void setUcsToWorld()
void setBrightness(double)
double frontClipDistance() const
OdGePoint3d centerPoint() const
double viewHeight() const
void showHiddenLines()
void erased(const OdDbObject *pObj, bool pErasing)
void setElevation(double elevation)
bool hiddenLinesRemoved() const
void zoomExtents()
bool isFrontClipOn() const
bool isUcsSavedWithViewport() const
double lensLength() const
void setSnapOff()
OdDbObjectId getLabelBlock() const
void setDefaultLightingType(OdGiViewportTraits::DefaultLightingType typ)
bool isDefaultLightingOn() const
void setCenterPoint(const OdGePoint3d &centerPoint)
void setVisualStyle(const OdDbObjectId &visualStyle)
ODDB_DECLARE_MEMBERS(OdDbViewport)
void setOpaque()
bool isNonRectClipOn() const
double contrast() const
bool isPerspectiveOn() const
void setGridFollow(bool bNewVal)
OdString plotStyleSheet() const
void getFrozenLayerList(OdDbObjectIdArray &layerIds) const
OdGiViewportTraits::DefaultLightingType defaultLightingType() const
void thawLayersInViewport(const OdDbObjectIdArray &layerIds)
OdDbXrefObjectId getModelView() const
void modified(const OdDbObject *pObj)
bool isLayerFrozenInViewport(const OdDbObjectId &layerId) const
void setFastZoomOn()
void setBackground(const OdDbObjectId &backgroundId)
void freezeLayersInViewport(const OdDbObjectIdArray &layerIds)
void setFrontClipAtEyeOff()
void setLensLength(double lensLength)
bool isFastZoomOn() const
void setViewHeight(double viewHeight)
OdGeVector2d gridIncrement() const
OdGePoint3d viewTarget() const
void setSnapIncrement(const OdGeVector2d &snapIncrement)
void setDefaultLightingOn(bool on)
void setAmbientLightColor(const OdCmColor &clr)
virtual OdResult dxfInFields_R12(OdDbDxfFiler *pFiler)
bool isOn() const
bool isUcsIconVisible() const
OdDbObjectId background() const
void subClose()
OdDbObjectId ucsName() const
void setViewTarget(const OdGePoint3d &viewTarget)
void setRenderMode(OdDb::RenderMode renderMode)
void toneOperatorParameters(OdGiToneOperatorParameters &params) const
void updateDisplay() const
virtual void dxfOutFields(OdDbDxfFiler *pFiler) const
void setUcsFollowModeOn()
void setUcsFollowModeOff()
void setCircleSides(OdUInt16 circleSides)
OdCmColor ambientLightColor() const
void setFastZoomOff()
virtual OdResult dwgInFields(OdDbDwgFiler *pFiler)
void setShadePlot(const ShadePlotType type, const OdDbObjectId &shadePlotId)
OdDbAnnotationScalePtr annotationScale() const
void setBackClipDistance(double backClipDistance)
bool isUcsOrthographic(OdDb::OrthographicView &viewType, const OdDbDatabase *pDb=0) const
OdGePoint2d snapBasePoint() const
void setViewDirection(const OdGeVector3d &viewDirection)
bool isGridFollow() const
double backClipDistance() const
OdDbObjectId setSun(OdDbSun *pSun)
void setUcs(const OdDbObjectId &ucsId)
void setGridOn()
virtual OdResult subGetGeomExtents(OdGeExtents3d &extents) const
bool isSnapOn() const
void setModelView(const OdDbXrefObjectId &objId)
void getUcs(OdGePoint3d &origin, OdGeVector3d &xAxis, OdGeVector3d &yAxis) const
StandardScaleType standardScale() const
OdInt16 number() const
void setSheetView(const OdDbObjectId &objId)
ShadePlotType shadePlot() const
OdResult subErase(bool erasing)
OdResult setAnnotationScale(const OdDbAnnotationScale *pScaleObj)
OdDbObjectId visualStyle() const
void setSnapAngle(double snapAngle)
bool isGridOn() const
double brightness() const
bool isTransparent() const
void setFrontClipOff()
OdDbObjectId sunId() const
virtual OdUInt32 subSetAttributes(OdGiDrawableTraits *pTraits) const
void setHeight(double height)
void setLocked()
void removeHiddenLines()
void setGridIncrement(const OdGeVector2d &gridIncrement)
OdString effectivePlotStyleSheet() const
void setNonRectClipOn()
void setSnapOn()
double snapAngle() const
void setToneOperatorParameters(const OdGiToneOperatorParameters &params)
double twistAngle() const
virtual OdResult dxfInFields(OdDbDxfFiler *pFiler)
void setTransparent()
void setUcsIconInvisible()
void setSnapIsometric()
void setContrast(double)
OdDbObjectId getSheetView() const
bool isGridSubdivisionRestricted() const
void setFrontClipOn()
void setFrontClipAtEyeOn()
OdUInt16 circleSides() const
virtual OdResult subGetTransformedCopy(const OdGeMatrix3d &mat, OdDbEntityPtr &pCopy) const
double height() const
void setPerspectiveOn()
bool isGridBoundToLimits() const
virtual void dxfOutFields_R12(OdDbDxfFiler *pFiler) const
virtual OdResult explodeGeometry(OdRxObjectPtrArray &entitySet) const
void removeModelView()
OdUInt16 gridMajor() const
bool plotWireframe() const
void setUcsIconAtOrigin()
void removeSheetView()
void setTwistAngle(double twistAngle)
void setSnapIsoPair(OdUInt16 snapIsoPair)
OdGeVector2d snapIncrement() const
virtual void subSetDatabaseDefaults(OdDbDatabase *pDb, bool doSubents)
void setNonRectClipEntityId(OdDbObjectId clipEntityId)
Definition: Gs.h:133
GLenum GLint * params
Definition: gles2_ext.h:184
GLint GLenum GLsizei width
Definition: gles2_ext.h:110
GLuint GLsizei GLsizei GLint GLenum * type
Definition: gles2_ext.h:274
GLint GLenum GLsizei GLsizei height
Definition: gles2_ext.h:110
OrthographicView
Definition: ViewportDefs.h:35
RenderMode
Definition: ViewportDefs.h:46