CFx SDK Documentation 2024 SP0
Loading...
Searching...
No Matches
DbViewport.h
Go to the documentation of this file.
1
2// Copyright (C) 2002-2022, 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 Open Design Alliance software pursuant to a license
16// agreement with Open Design Alliance.
17// Open Design Alliance Copyright (C) 2002-2022 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#include "DwgDeclareMembers.h"
36
37class OdGeExtents3d;
38class OdGeMatrix3d;
39class OdGsView;
40class OdDbSun;
41
48{
49protected:
50 /* void dxfOutXData(OdDbDxfFiler* pFiler) const;
51 */
52public:
54
56
66 double height() const;
67
79 double height);
80
90 double width() const;
91
103 double width);
104
109
115 const OdGePoint3d& centerPoint);
116
123
127 bool isOn() const;
128
132 void setOn();
133
137 void setOff();
138
143
149 const OdGePoint3d& viewTarget);
150
155
161 const OdGeVector3d& viewDirection);
162
166 double viewHeight() const;
167
173 double viewHeight);
174
179
185 const OdGePoint2d& viewCenter);
186
193 double twistAngle() const;
194
202 double twistAngle);
203
207 double lensLength() const;
208
214 double lensLength);
215
219 bool isFrontClipOn() const;
220
225
230
234 bool isBackClipOn() const;
235
240
245
251 bool isFrontClipAtEyeOn() const;
252
259
264
268 double frontClipDistance() const;
269
275 double frontClipDistance);
276
280 double backClipDistance() const;
281
287 double backClipDistance);
288
292 bool isPerspectiveOn() const;
293
298
303
307 bool isUcsFollowModeOn() const;
308
313
318
322 bool isUcsIconVisible() const;
323
328
333
337 bool isUcsIconAtOrigin() const;
338
343
348
352 bool isFastZoomOn() const;
353
358
363
370
376 OdUInt16 circleSides);
377
381 bool isSnapOn() const;
382
386 void setSnapOn();
387
392
396 bool isSnapIsometric() const;
397
402
407
411 double snapAngle() const;
412
420 double snapAngle);
421
426
432 const OdGePoint2d& snapBasePoint);
433
438
444 const OdGeVector2d& snapIncrement);
445
459
474 OdUInt16 snapIsoPair);
475
479 bool isGridOn() const;
480
484 void setGridOn();
485
490
495
501 const OdGeVector2d& gridIncrement);
502
506 bool hiddenLinesRemoved() const;
507
512
517
527 const OdDbObjectIdArray& layerIds);
528
538 const OdDbObjectIdArray& layerIds);
539
544
550 const OdDbObjectId& layerId) const;
551
557 OdDbObjectIdArray& layerIds) const;
558
568 void updateDisplay() const;
569
570
572 OdGiDrawableTraits* pTraits) const;
573
574 virtual bool subWorldDraw(
575 OdGiWorldDraw* pWd) const;
576
580 bool isLocked() const;
581
585 void setLocked();
586
591
595 bool isTransparent() const;
596
601
605 void setOpaque();
606
608 {
609 kScaleToFit, // Scaled to Fit
610 kCustomScale, // Scale is not a standard scale
611 k1_1, // 1:1
612 k1_2, // 1:2
613 k1_4, // 1:4
614 k1_5, // 1:5
615 k1_8, // 1:8
616 k1_10, // 1:10
617 k1_16, // 1:16
618 k1_20, // 1:20
619 k1_30, // 1:30
620 k1_40, // 1:40
621 k1_50, // 1:50
622 k1_100, // 1:100
623 k2_1, // 2:1
624 k4_1, // 4:1
625 k8_1, // 8:1
626 k10_1, // 10:1
627 k100_1, // 100:1
628 k1_128in_1ft, // 1/128"= 1'
629 k1_64in_1ft, // 1/64"= 1'
630 k1_32in_1ft, // 1/32"= 1'
631 k1_16in_1ft, // 1/16"= 1'
632 k3_32in_1ft, // 3/32"= 1'
633 k1_8in_1ft, // 1/8" = 1'
634 k3_16in_1ft, // 3/16"= 1'
635 k1_4in_1ft, // 1/4" = 1'
636 k3_8in_1ft, // 3/8" = 1'
637 k1_2in_1ft, // 1/2" = 1'
638 k3_4in_1ft, // 3/4" = 1'
639 k1in_1ft, // 1" = 1'
640 k1and1_2in_1ft, // 1 1/2"= 1'
641 k3in_1ft, // 3" = 1'
642 k6in_1ft, // 6" = 1'
643 k1ft_1ft // 1' = 1'
644 };
645
647 {
648 kAsDisplayed = 0, // As displayed
649 kWireframe = 1, // Wireframe
650 kHidden = 2, // Hidden
651 kRendered = 3, // Rendered
652 kVisualStyle = 4, // Visual style
653 kRenderPreset = 5 // Render preset
654 };
655
659 double customScale() const;
660
666 double customScale);
667
672
678 const StandardScaleType standardScale);
679
684
689
694 const OdString& plotStyleSheetName);
695
699 bool isNonRectClipOn() const;
700
705
710
715
738 OdDbObjectId clipEntityId);
739
740 /*
741 virtual void erased(const OdDbObject* , bool);
742 virtual void modified(const OdDbObject *);
743 virtual void copied(const OdDbObject* pDbObj,const OdDbObject* pNewObj);
744 virtual void subObjModified(const OdDbObject* pDbObj, const OdDbObject* pSubObj);
745 */
746
754 void getUcs(OdGePoint3d& origin,
755 OdGeVector3d& xAxis,
756 OdGeVector3d& yAxis) const;
757
782 OdDb::OrthographicView& viewType,
783 const OdDbDatabase* pDb = 0) const;
784
789
796 double elevation() const;
797
805 void setUcs(
806 const OdGePoint3d& origin,
807 const OdGeVector3d& xAxis,
808 const OdGeVector3d& yAxis);
809
830 void setUcs(
831 OdDb::OrthographicView viewType, const OdDbDatabase* pDb = 0);
832
838 void setUcs(
839 const OdDbObjectId& ucsId);
840
845
853 double elevation);
854
855 /*
856 bool isViewOrthographic(OdDb::OrthographicView& view) const;
857
858 void setViewDirection(OdDb::OrthographicView view);
859 */
860
866
874 bool ucsPerViewport);
875
895 OdDb::RenderMode renderMode);
896
916
921
930 const ShadePlotType shadePlot);
931
932 // New in R21 functions
933
939
948 void setShadePlot(const ShadePlotType type, const OdDbObjectId& shadePlotId);
949
959 bool plotWireframe() const;
960
970 bool plotAsRaster() const;
971
976
982 void setBackground(const OdDbObjectId& backgroundId);
983
984 // Visual Styles
985
990
996 void setVisualStyle(const OdDbObjectId& visualStyle);
997
998 // Viewport Lighting
999
1007
1014
1019
1026
1027 // Brightness controls the relative intensity of lights.
1028
1032 double brightness() const;
1033
1039 void setBrightness(double);
1040
1041 // Contrast controls intensity of ambient light, relative to other lights.
1042
1046 double contrast() const;
1047
1053 void setContrast(double);
1054
1059
1066
1067 // A single sun (distant light) can be associated with each viewport.
1068
1073
1082
1088
1094
1101
1106
1113
1119 void setGridBoundToLimits(bool bNewVal);
1120
1128 bool isGridAdaptive() const;
1129
1136 void setGridAdaptive(bool bNewVal);
1137
1146
1155
1161 bool isGridFollow() const;
1162
1168 void setGridFollow(bool bNewVal);
1169
1174
1183
1184 // View association methods
1185
1196 void setModelView(const OdDbXrefObjectId &objId);
1197
1204
1209
1219
1228 void setSheetView(const OdDbObjectId &objId);
1229
1236
1241
1247 void setLabelBlock(const OdDbObjectId objId);
1248
1255
1260
1261 // OdGsView association methods
1262
1267
1274
1275 // OdDbEntity overrides
1276
1289 OdDbDatabase* pDb,
1290 bool doSubents);
1291
1310 OdDbDwgFiler* pFiler);
1311
1327 virtual void dwgOutFields(
1328 OdDbDwgFiler* pFiler) const;
1329
1348 OdDbDxfFiler* pFiler);
1349
1365 virtual void dxfOutFields(
1366 OdDbDxfFiler* pFiler) const;
1367
1378 OdDbDxfFiler* pFiler);
1379
1389 virtual void dxfOutFields_R12(
1390 OdDbDxfFiler* pFiler) const;
1391
1401 void* pClsid) const;
1402
1411 void subClose();
1412
1425 bool erasing);
1426
1432
1434 OdGeExtents3d& extents) const;
1435
1444 const OdGeMatrix3d& xfm) ODRX_OVERRIDE;
1445
1453 void modified(const OdDbObject* pObj);
1454
1461 void erased(const OdDbObject* pObj, bool pErasing);
1462
1473
1483private:
1484 void applyClipBoundary(const OdDbObject* pClipEnt);
1485};
1486
1491
1492#include "TD_PackPop.h"
1493
1494#endif
#define TOOLKIT_EXPORT
Definition: DbExport.h:40
OdSmartPtr< OdDbViewport > OdDbViewportPtr
Definition: DbViewport.h:1490
unsigned int OdUInt32
short OdInt16
unsigned short OdUInt16
#define ODRX_OVERRIDE
OdResult
Definition: OdResult.h:29
Definition: DbSun.h:44
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)
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)
OdGsView * gsView() const
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)
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()
DWGMAP_DECLARE_MEMBERS(OdDbViewport)
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:140
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