CFx SDK Documentation  2023 SP0
GsViewImpl.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 ODGSVIEWIMPL_INC
25 #define ODGSVIEWIMPL_INC
26 
27 #include "TD_PackPush.h"
28 #include "Gs/Gs.h"
29 #include "Gs/GsBaseModule.h"
30 #include "Gs/GsDCRectArray.h"
31 #include "DbStubPtrArray.h"
32 #include "Ge/GePoint3d.h"
33 #include "Ge/GeVector3d.h"
34 #include "Ge/GeMatrix3d.h"
35 #include "UInt8Array.h"
36 #include "SharedPtr.h"
37 #include "Gs/GsDrawableHolder.h"
38 #include "Gi/GiCommonDraw.h"
39 #include "Gs/GsProperties.h"
40 #include "Gs/GsCullingVolume.h"
41 #include "Gs/GsViewLocalId.h"
42 #include "Gs/GsOverlayDefs.h"
44 #include "OdMutex.h"
45 
47 class OdGeBoundBlock3d;
48 class OdGiPathNode;
49 
58 {
59 public:
61 
64 
65  // OdGsView methods
66 
74  virtual void init(OdGsBaseVectorizeDevice* pDevice,
75  const OdGsClientViewInfo* pViewInfo = 0,
76  bool enableLayerVisibilityPerView = false);
77 
78  virtual OdGsDevice* device() const;
79 
80  virtual void clientViewInfo(OdGsClientViewInfo& viewInfo) const;
81 
82  virtual RenderMode mode() const;
84  virtual void setMode(RenderMode mode);
85 
86  virtual void freezeLayer(OdDbStub* layerID);
87  virtual void thawLayer(OdDbStub* layerID);
88  virtual void clearFrozenLayers();
89 
90  virtual void setViewportBorderProperties(ODCOLORREF color, int width);
91  virtual void getViewportBorderProperties(ODCOLORREF& color, int& width) const;
92  virtual void setViewportBorderVisibility(bool visible);
93  virtual bool isViewportBorderVisible() const;
94 
95  virtual void setEnableFrontClip(bool enable);
96  virtual bool isFrontClipped() const;
97  virtual void setFrontClip(double distance);
98  virtual double frontClip() const;
99 
100  virtual void setEnableBackClip(bool enable);
101  virtual bool isBackClipped() const;
102  virtual void setBackClip(double distance);
103  virtual double backClip() const;
104 
105  virtual OdGePoint3d position() const;
106  virtual OdGePoint3d target() const;
107  virtual OdGeVector3d upVector() const;
108  virtual double fieldWidth() const;
109  virtual double fieldHeight() const;
113  double windowAspect() const;
114 
115  virtual double lensLength() const;
116  virtual void setLensLength(double lensLength);
117 
118  virtual bool isPerspective() const;
119 
120  virtual void beginInteractivity(double frameRateInHz);
121  virtual bool isInInteractivity() const;
122  virtual double interactivityFrameRate() const;
123  virtual void endInteractivity();
124  virtual void flush();
125 
126  virtual void hide();
127  virtual void show();
128  virtual bool isVisible();
129 
130  virtual OdGsViewPtr cloneView(bool cloneViewParameters = true, bool cloneGeometry = false);
131  virtual bool exceededBounds();
132  virtual void enableStereo(bool enabled);
133  virtual bool isStereoEnabled() const;
134  virtual void setStereoParameters(double magnitude, double parallax);
135  virtual void getStereoParameters(double& magnitude, double& parallax) const;
136  virtual void initLights(OdRxIterator* pLightsIterator);
137  virtual void getSnapShot(OdGiRasterImagePtr &pImage, const OdGsDCRect &region);
138 
139  virtual void setViewport(const OdGePoint2d& lowerLeft, const OdGePoint2d& upperRight);
140  virtual void setViewport(const OdGsDCRect& screenRect);
141  virtual void setViewport(const OdGsDCRectDouble& screenRec);
142 
143  virtual void getViewport(OdGePoint2d& lowerLeft, OdGePoint2d& upperRight) const;
144  virtual void getViewport(OdGsDCRect& screenRect) const;
145  virtual void getViewport(OdGsDCRectDouble& screenRec) const;
146 
147  virtual OdGeMatrix3d screenMatrix() const;
150  virtual OdGeMatrix3d viewingMatrix() const;
152 
153  virtual void viewParameters(OdGsView* pView) const;
154 
155  virtual double lineweightToDcScale() const;
156  virtual void setLineweightToDcScale(double scale);
157  virtual void setLineweightEnum(int numLineweights, const OdUInt8* lineweights);
158  virtual void setLinetypeScaleMultiplier(double linetypeScaleMultiplier);
159  virtual void setAlternateLinetypeScaleMultiplier(double linetypeAlternateScaleMultiplier);
160  virtual double linetypeScaleMultiplier() const;
161 
162  virtual void dolly(const OdGeVector3d& dollyVector);
163  virtual void dolly(double xDolly, double yDolly, double zDolly);
164  virtual void roll(double rollAngle);
165  virtual void orbit(double xOrbit, double yOrbit);
166  virtual void zoom(double zoomFactor);
167  virtual void pan(double xPan, double yPan);
168  virtual void setView(const OdGePoint3d & position,
169  const OdGePoint3d& target,
170  const OdGeVector3d& upVector,
171  double fieldWidth,
172  double fieldHeight,
173  Projection projection = kParallel);
174 
175  virtual void zoomExtents(const OdGePoint3d &minPt, const OdGePoint3d &maxPt);
176  virtual void zoomWindow(const OdGePoint2d &lowerLeft, const OdGePoint2d &upperRight);
177  virtual bool pointInView(const OdGePoint3d &pt) const;
178  virtual bool extentsInView(const OdGePoint3d &minPt, const OdGePoint3d &maxPt) const;
179 
180  virtual void viewportClipRegion(OdIntArray& counts, OdGePoint2dArray& vertices) const;
181  virtual void viewportClipRegion(OdIntArray& counts, OdGsDCPointArray& dcPts) const;
182  virtual void setViewportClipRegion(int numContours, const int* numVertices, const OdGePoint2d* vertices);
183  virtual void setViewportClipRegion(int numContours, int const* numVertices, OdGsDCPoint const* vertices);
184 
185  bool isDependentViewportView() const;
186  bool isDependentGeometryView() const;
187  bool isHelperView() const;
188 
189  const OdGsBaseModule *getGsModulePtr() const;
190 
191  const OdGiContextualColors *contextualColors() const;
192  void setContextualColors(OdGiContextualColors *pColors);
193 
194  virtual bool pointInViewport(const OdGePoint2d& screenPoint) const;
195 
196  virtual void setClearColor(ClearColor color);
197  virtual void invalidate();
198  virtual void invalidate(const OdGsDCRect &rect);
206  virtual void select(const OdGsDCPoint* points, int numPoints, OdGsSelectionReactor* pReactor,
207  SelectionMode mode = kCrossing);
208 
209  virtual bool add(OdGiDrawable* sceneGraph, OdGsModel* model);
210  virtual bool erase(OdGiDrawable* sceneGraph);
211  virtual void eraseAll();
212 
213  virtual OdGsModel *getModel(const OdGiDrawable *pDrawable) const;
214  virtual OdGsModelArray getModelList() const;
215 
216  virtual bool isValid() const;
217  virtual void getNumPixelsInUnitSquare(const OdGePoint3d& givenWorldpt,
218  OdGePoint2d& pixelArea, bool includePerspective = true) const;
219 
220  virtual void setBackground(OdDbStub *backgroundId);
221  virtual OdDbStub *background() const;
222  virtual void setVisualStyle(OdDbStub *visualStyleId);
223  virtual OdDbStub *visualStyle() const;
224  virtual void setVisualStyle(const OdGiVisualStyle &visualStyle);
225  virtual bool visualStyle(OdGiVisualStyle &vs) const;
226  virtual void enableDefaultLighting(bool bEnable, DefaultLightingType lightType = kTwoLights);
227  bool defaultLightingEnabled() const;
228  DefaultLightingType defaultLightingType() const;
229 
230  // OdGsViewImpl methods
231 
237  static OdGsViewImpl* safeCast(OdGsView* pView);
238  static const OdGsViewImpl* safeCast(const OdGsView* pView);
239 
240  OdUInt32 viewportId() const { return m_giViewportId; }
241  bool isValidViewportId(const OdUInt32 vpId) const;
242 
243  //NS TODO: rename to viewportObjectId()
244  OdDbStub* getViewportObjectId() const { return m_viewInfo.viewportObjectId; }
245 
249  OdGsBaseVectorizeDevice* baseDevice() { return m_pDevice; }
250  const OdGsBaseVectorizeDevice* baseDevice() const { return m_pDevice; }
251 
252  OdDbStub* annotationScaleId() const;
254 
263  virtual bool viewExtents(OdGeBoundBlock3d& extents) const = 0;
264 
265  // Own methods
266  virtual void select(const OdGePoint2d* aPtDc, int numPoints, OdGsSelectionReactor* pReactor,
267  SelectionMode mode = kCrossing) = 0;
268 
269  bool isSnapping() const;
270  void setSnapping(bool val);
271  bool isRegenOnDrawForbidden() const;
272  void setRegenOnDrawForbidden(bool val);
273  bool isAccumulateVpChanges() const;
274  virtual void clearLinetypeCache() = 0;
276 
277  // Legacy plot modes (#12611)
278  // Legacy Wireframe
279  virtual bool isSupportLegacyWireframeMode() const;
280  virtual bool isLegacyWireframeMode() const;
281  virtual void setLegacyWireframeMode(bool bSet);
282  // Legacy Hidden
283  virtual bool isSupportLegacyHiddenMode() const;
284  virtual bool isLegacyHiddenMode() const;
285  virtual void setLegacyHiddenMode(bool bSet);
286  // Returns true in case if current view supports plot styles rendering
287  bool isSupportPlotStyles() const;
288  // Transparencies plotting
289  virtual bool isPlotTransparency() const;
290  virtual void setPlotTransparency(bool bSet);
291 
299  OdUInt32 frozenLayers() const { return m_frozenLayers.size(); }
300 
310  void frozenLayers(OdDbStubPtrArray& frozenLayers) const { frozenLayers = m_frozenLayers; }
311  bool isLayerVisible(OdDbStub* layerId) const;
312 
317  int lineweightToPixels(OdDb::LineWeight lineweight) const;
318 
323  double lineweightToPixels(double lineweight) const;
324 
330  void screenRect(OdGsDCPoint &lowerLeft, OdGsDCPoint &upperRight) const;
331 
337  void screenRect(OdGePoint2d &lowerLeft, OdGePoint2d &upperRight) const;
338  void screenRectNorm(OdGsDCRect& normalizedRect) const;
339  void viewportDcCorners(OdGePoint2d& lower_left, OdGePoint2d& upper_right) const;
340  bool doPerspectivePt(OdGePoint3d& point) const;
342 
343  const OdGeMatrix3d& eyeToWorldMatrix() const;
344  const OdGeMatrix3d& worldToEyeMatrix() const;
349  {
350  kProjectionIncludeDept = (1 << 0),
351  kProjectionIncludeClip = (1 << 1),
352  kProjectionIncludePerspective = (1 << 2),
353  kProjectionIncludeRotation = (1 << 3),
354  kProjectionIncludeAll = 0x0F,
355  kProjectionIncludeAllNoDept = kProjectionIncludeAll & ~kProjectionIncludeDept
356  };
358 
360 
361  virtual void invalidate(const OdGeExtents3d& worldExt, const OdGsModel *pModel, OdDb::LineWeight extendByLineweight = OdDb::kLnWt000);
362  void invalidate(const OdGsUpdateExtents& extents, const OdGsModel *pModel);
363  void invalidateRegion(const OdGiPathNode& path);
364 
369  bool isViewportOnScreen() const;
370 
371  bool isCompletelyVisible() const;
372  void setCompletelyVisible(bool val);
373 
374  // Since layout view can be rotated to 90, 180 or 270 (for printing)
375  // views linked to viewports of this layout must be rotated accordingly.
376  // To determine viewport's rotation angle by it's corners coordinates
377  // it's necessary to know if overall layout's window coordinates inverted.
378  //
379  // For example overall layout's output rectangle can be (0,0)-(100,100)
380  // or (0,100)-(100,0)
381  // This means invertedX == invertedY == false in the first case and
382  // invertedX = false, invertedY == true in the second.
383  // Vieport with coordinates (10,10)-(90,90) inside this layout will be
384  // considered unrotated in the first case or rotated to 270 degrees
385  // in the second case.
386  void setInversion(bool invertedX, bool invertedY);
387 
388  OdGiRegenType getRegenType() const { return m_regenerationType; }
389 
393  double focalLength() const;
394 
395  const OdGeVector3d& eyeVector() const { return m_eyeVector; }
396  const OdGeVector3d& xVector() const { return m_xVector; }
397  const OdGeVector3d& getUpVector() const { return m_upVector; }
398 
401 
402  virtual double getDeviation(const OdGiDeviationType deviationType,
403  const OdGePoint3d& pointOnCurve, bool bRecalculate = false) const;
405 
409  int cachedDrawables() const { return m_nCachedDrawables!=0; }
410 
411 #ifdef ODGS_LOCAL_IDS
412  // Local viewport ID section
413  OdUInt32 localViewportId(const OdGsBaseModel *pModel) const
414  {
415  return m_localId.localViewportId(pModel);
416  }
417  virtual bool isLocalViewportIdCompatible(const OdGsViewImpl *pView) const;
418  OdGsViewLocalId &getViewLocalId()
419  {
420  return m_localId;
421  }
422 #endif
423  virtual bool isViewRegenerated() const;
424 protected:
433  virtual bool sceneDept(double& zNear, double& zFar, OdGsOverlayId nOverlay) const;
434  // This is old version of sceneDept overrideable method, which is still provided for compatibility with
435  // old vectorizers. Don't override it in new vectorizers, use new sceneDept method version even if
436  // your vectorizer doesn't support overlay buffers. This method will be removed in one of next Teigha versions.
437  virtual bool sceneDept(double& zNear, double& zFar) const;
438 
449  virtual bool usesDept(double* pMinDeptSupported = 0, double* pMaxDeptSupported = 0) const;
450 protected:
455 
460 
461  virtual void updateViewProps(bool bFullUpdate = true);
462 
463  inline bool isCheckValid() const;
464  inline void setCheckValid(bool bValue) const;
465  inline bool isInvalid() const;
466  inline void setInvalid(bool bValue) const;
467  inline void setPerspectiveEnabled(bool bValue) const;
468 
469 public:
470  inline bool isNonRectClipped() const;
471  inline bool hasLweights() const { return !m_lweights.empty(); }
472  inline const OdUInt8Array &getLweightsEnum() const { return m_lweights; }
473 
474  const OdGePoint2d& dcScreenMin() const { return m_dcScreenMin; }
475  const OdGePoint2d& dcScreenMax() const { return m_dcScreenMax; }
476  const OdGePoint2d& dcLowerLeft() const { return m_dcLowerLeft; }
477  const OdGePoint2d& dcUpperRight() const { return m_dcUpperRight; }
478 
483 
490  static double lensLengthToFOV(double lensLength);
499  static double lensLengthFromFOV(double fovAngle);
500 
504 
505  void registerOverlay(const OdGsModel *pModel);
506  void unregisterOverlay(const OdGsModel *pModel);
507 
514  virtual int partialUpdateExtentsEnlargement() const;
515 protected:
522  virtual void propagateInvalidVpFlag();
523  virtual void propagateLayersChanges();
524 
525 public:
526  double calcDeviation(const OdGiDeviationType type, const OdGePoint3d& pt) const;
527 
528  // Viewport properties (backgrounds, render settings, visual styles) management
532 
533  // Printing support methods
534 
535  const OdGeMatrix3d& rotationMatrix() const;
536  short viewportRotation() const;
537  inline bool isRotated() const;
538 
569  double unrotatedFieldHeight() const;
570  double unrotatedFieldWidth() const;
571 
575  double actualFieldWidth() const;
579  double actualFieldHeight() const;
580 
581  // Primitives culling routines
582 
598  virtual void initCullingVolume();
623  virtual bool isCullingVolumeInitialized() const;
633  virtual bool cullingVolumeIntersectWithOpt(const OdGsCullingPrimitive &prim) const;
661  virtual void cullingVolumeTransformBy(const OdGeMatrix3d &xfm);
662 
669  virtual void setViewport3dClipping(const OdGiClipBoundary* pBoundary, const OdGiAbstractClipBoundary* pClipInfo = NULL);
675  virtual const OdGiClipBoundary *viewport3dClipping(const OdGiAbstractClipBoundary** ppClipInfo = NULL) const;
679  OdGiClipBoundaryWithAbstractData *viewport3dClippingObject();
683  bool hasViewport3dClipping() const;
684 
685  virtual bool saveViewState(OdGsFiler *pFiler) const;
686  virtual bool loadViewState(OdGsFiler *pFiler);
687  virtual bool saveClientViewState(OdGsFiler *pFiler) const;
688  virtual bool loadClientViewState(OdGsFiler *pFiler);
689 
690  virtual const OdDbStubPtrArray& getFrozenLayersDiff() const;
691 private:
692  void setExtents(OdGsOverlayId nOverlay, const OdGeExtents3d& ext, bool bAdd);
693  void getExtents(OdGsOverlayId nOverlay, OdGeExtents3d& ext) const;
694 
695 private:
696  enum EGsViewImplFlags
697  {
698  kFirstViewImplFlag = 1,
699 
700  kInvalid = kFirstViewImplFlag << 0, // device surface entirely invalid
701  kCheckValid = kFirstViewImplFlag << 1, // device surface entirely valid
702  kBorderVisible = kFirstViewImplFlag << 2,
703  kDoFrontClip = kFirstViewImplFlag << 3,
704  kDoBackClip = kFirstViewImplFlag << 4,
705  kPerspectiveEnabled = kFirstViewImplFlag << 5,
706  kHidden = kFirstViewImplFlag << 6, // view is hidden
707  kTransparentClearColor = kFirstViewImplFlag << 7,
708  kDevBgClearColor = kFirstViewImplFlag << 8,
709  kEyeToWorldValid = kFirstViewImplFlag << 9,
710  kWorldToEyeValid = kFirstViewImplFlag << 10,
711  kSnapping = kFirstViewImplFlag << 11,
712  kForbidDrawableRegenDraw = kFirstViewImplFlag << 12,
713  kDepViewInside = kFirstViewImplFlag << 13,
714  kLegacyWireframe = kFirstViewImplFlag << 14,
715  // there are two modes with hidden lines removed:
716  // - normal, set by SHADEMODE command in CAD for display and
717  // represented by 'Hidden' visual style in shade plot viewport/layout props for printing, and
718  // - legacy, set by HIDE command in CAD for display and
719  // according to 'OdDbViewport/OdDbPlotSettings::kHidden' shade plot for printing;
720  // they both use 'kHiddenLine' render mode, but have some differences, e.g. in plot style usage;
721  // this flag is to distinguish these two cases
722  kLegacyHidden = kFirstViewImplFlag << 15,
723  kPlotTransparency = kFirstViewImplFlag << 16,
724  kAccumulateVpChanges = kFirstViewImplFlag << 17,
725  kDefaultLightingEnabled = kFirstViewImplFlag << 18
726  };
727 
728 protected: //FELIX_CHANGE
732 
744 
745  double m_fieldWidth;
747  double m_lensLength;
749 
757 
766 
767  double m_deviation[5];
768 
771 
773  OdDbStub *m_pBackgroundId;
774  OdDbStub *m_pVisualStyleId;
777 
778 protected:
780  {
782  {
783  kWorldToDeviceValid = (1 << 0),
784  kSceneDeptInvalid = (1 << 1)
785  };
789  GsViewOverlayData() : m_nOverlayFlags(0) {}
790  };
792  {
793  public:
795  void setSceneDeptInvalid(OdGsOverlayId nOverlay, bool bSet) const;
796  };
798 protected:
802 #ifdef ODGS_LOCAL_IDS
803  OdGsViewLocalId m_localId;
804 #endif
806  // Reserved pointer for internal use (binary incompatible changes), do not delete.
808 
809  // Made protected for access in OdGiViewport methods
811 
813 
815 
818 
819  friend class GsViewImplHelper;
821  friend class OdGsBaseVectorizer;
822  friend class OdGsBaseModule;
824 };
825 
827 {
829 }
830 
832 {
834 }
835 
836 inline bool OdGsViewImpl::isHelperView() const
837 {
839 }
840 
842 {
843  return m_pModule.get();
844 }
845 
847 {
848  return m_viewInfo.contextColors.get();
849 }
850 
852 {
853  m_viewInfo.contextColors = pColors;
854  invalidate();
855 }
856 
858 {
860 }
861 
862 inline bool OdGsViewImpl::isCheckValid() const
863 {
864  return GETBIT(m_gsViewImplFlags, kCheckValid);
865 }
866 
867 inline void OdGsViewImpl::setCheckValid(bool bValue) const
868 {
869  SETBIT(m_gsViewImplFlags, kCheckValid, bValue);
870 }
871 
872 inline bool OdGsViewImpl::isInvalid() const
873 {
875 }
876 
877 inline void OdGsViewImpl::setInvalid(bool bValue) const
878 {
880 }
881 
882 inline void OdGsViewImpl::setPerspectiveEnabled(bool bValue) const
883 {
884  SETBIT(m_gsViewImplFlags, kPerspectiveEnabled, bValue);
885 }
886 
888 {
889  return GETBIT(m_gsViewImplFlags, kDefaultLightingEnabled);
890 }
891 
893 {
894  return m_defaultLightingType;
895 }
896 
898 {
899  return m_nrcCounts.size() != 0;
900 }
901 
902 inline bool OdGsViewImpl::isRotated() const
903 {
904  short rotation = viewportRotation();
905  return rotation == 90 || rotation == 270;
906 }
907 
908 inline void OdGsViewImpl::invalidate(const OdGsUpdateExtents& extents, const OdGsModel *pModel)
909 {
910  invalidate(extents.getExtents(), pModel, extents.getLineweight());
911 }
912 
914 {
915  if(!GETBIT(m_gsViewImplFlags, kEyeToWorldValid))
916  {
918  SETBIT(m_gsViewImplFlags, kEyeToWorldValid, true);
919  }
920  return m_eyeToWorld;
921 }
922 
924 {
925  if(!GETBIT(m_gsViewImplFlags, kWorldToEyeValid))
926  {
928  SETBIT(m_gsViewImplFlags, kWorldToEyeValid, true);
929  }
930  return m_worldToEye;
931 }
932 
934 {
935  return OdSmartPtr<OdGsViewImpl>(pView).get();
936 }
937 
938 inline const OdGsViewImpl* OdGsViewImpl::safeCast(const OdGsView* pView)
939 {
940  return OdSmartPtr<OdGsViewImpl>(pView).get();
941 }
942 
943 inline bool OdGsViewImpl::isSnapping() const
944 {
945  return GETBIT(m_gsViewImplFlags, kSnapping);
946 }
947 
948 inline void OdGsViewImpl::setSnapping(bool val)
949 {
950  SETBIT(m_gsViewImplFlags, kSnapping, val);
951 }
952 
954 {
955  return GETBIT(m_gsViewImplFlags, kForbidDrawableRegenDraw);
956 }
957 
959 {
960  SETBIT(m_gsViewImplFlags, kForbidDrawableRegenDraw, val);
961 }
962 
964 {
965  return GETBIT(m_gsViewImplFlags, kAccumulateVpChanges);
966 }
967 
969 {
970  return GETBIT(m_gsViewImplFlags, kDepViewInside);
971 }
972 
974 {
975  SETBIT(m_gsViewImplFlags, kDepViewInside, val);
976 }
977 
979 {
980  return m_p3dClip.get();
981 }
982 
984 {
985  return !m_p3dClip.isNull();
986 }
987 
988 inline double OdGsViewImpl::actualFieldWidth() const
989 {
990  return m_fieldWidth;
991 }
992 
993 inline double OdGsViewImpl::actualFieldHeight() const
994 {
995  return m_fieldHeight;
996 }
997 
998 #include "TD_PackPop.h"
999 
1000 #endif // ODGSVIEWIMPL_INC
scale
Definition: DimVarDefs.h:1684
OdGiRegenType
Definition: GiCommonDraw.h:50
OdGiDeviationType
Definition: GiCommonDraw.h:64
#define GS_TOOLKIT_EXPORT
Definition: GsExport.h:37
OdGsOverlayId
Definition: GsOverlayDefs.h:40
@ kGsMainOverlay
Definition: GsOverlayDefs.h:41
#define NULL
Definition: GsProperties.h:177
#define ODCOLORREF
Definition: OdPlatform.h:883
unsigned int OdUInt32
unsigned char OdUInt8
ptrdiff_t OdIntPtr
#define SETBIT(flags, bit, value)
Definition: OdaDefs.h:499
#define GETBIT(flags, bit)
Definition: OdaDefs.h:500
size_type size() const
Definition: OdArray.h:893
OdGeMatrix3d & setCoordSystem(const OdGePoint3d &origin, const OdGeVector3d &xAxis, const OdGeVector3d &yAxis, const OdGeVector3d &zAxis)
OdGeMatrix3d inverse() const
const OdGeExtents3d & getExtents() const
OdDb::LineWeight getLineweight() const
Definition: Gs.h:133
virtual void invalidate()=0
ClearColor
Definition: Gs.h:920
DefaultLightingType
Definition: Gs.h:168
SelectionMode
Definition: Gs.h:157
RenderMode
Definition: Gs.h:138
@ k2DOptimized
Definition: Gs.h:140
Projection
Definition: Gs.h:151
void setSceneDeptInvalid(OdGsOverlayId nOverlay, bool bSet) const
const OdGePoint2d & dcScreenMin() const
Definition: GsViewImpl.h:474
double m_fieldHeight
Definition: GsViewImpl.h:746
OdUInt32 viewportId() const
Definition: GsViewImpl.h:240
virtual void endInteractivity()
OdUInt8Array m_lweights
Definition: GsViewImpl.h:763
virtual double interactivityFrameRate() const
virtual void dolly(const OdGeVector3d &dollyVector)
virtual void invalidateCachedViewportGeometry()
virtual bool exceededBounds()
double m_dInteractivityFrameRate
Definition: GsViewImpl.h:817
void setPerspectiveEnabled(bool bValue) const
Definition: GsViewImpl.h:882
virtual const OdDbStubPtrArray & getFrozenLayersDiff() const
virtual bool isViewRegenerated() const
virtual bool saveViewState(OdGsFiler *pFiler) const
virtual void setEnableBackClip(bool enable)
OdGsClientViewInfo m_viewInfo
Definition: GsViewImpl.h:800
virtual void initLights(OdRxIterator *pLightsIterator)
OdDbStubPtrArray m_frozenLayersDiff
Definition: GsViewImpl.h:731
virtual OdGsDevice * device() const
bool hasLweights() const
Definition: GsViewImpl.h:471
const OdGeMatrix3d & eyeToWorldMatrix() const
Definition: GsViewImpl.h:913
virtual double getDeviation(const OdGiDeviationType deviationType, const OdGePoint3d &pointOnCurve, bool bRecalculate=false) const
OdGePoint2d m_dcUpperRight
Definition: GsViewImpl.h:743
ODCOLORREF m_borderColor
Definition: GsViewImpl.h:734
virtual bool visualStyle(OdGiVisualStyle &vs) const
virtual void setAlternateLinetypeScaleMultiplier(double linetypeAlternateScaleMultiplier)
bool isDependentViewportView() const
Definition: GsViewImpl.h:826
double windowAspect() const
virtual OdGePoint3d position() const
virtual bool isPlotTransparency() const
virtual OdGePoint3d target() const
virtual OdGeMatrix3d screenMatrix() const
virtual bool pointInView(const OdGePoint3d &pt) const
OdDbStub * annotationScaleId() const
bool isLayerVisible(OdDbStub *layerId) const
virtual void getNumPixelsInUnitSquare(const OdGePoint3d &givenWorldpt, OdGePoint2d &pixelArea, bool includePerspective=true) const
const OdGiContextualColors * contextualColors() const
Definition: GsViewImpl.h:846
bool isSupportPlotStyles() const
Definition: GsViewImpl.h:857
OdGeMatrix3d m_worldToEye
Definition: GsViewImpl.h:756
bool m_bInInteractivityMode
Definition: GsViewImpl.h:816
virtual OdGeMatrix3d objectToDeviceMatrix() const
DefaultLightingType m_defaultLightingType
Definition: GsViewImpl.h:776
virtual bool isSupportLegacyHiddenMode() const
void setContextualColors(OdGiContextualColors *pColors)
Definition: GsViewImpl.h:851
OdGiDrawablePtr drawableAt(DrawableHolder &drawableHolder)
void screenRectNorm(OdGsDCRect &normalizedRect) const
OdUInt32 m_giViewportId
Definition: GsViewImpl.h:801
OdGsDCRectArray invalidRects(OdGsOverlayId nOverlay=kGsMainOverlay) const
virtual bool isValid() const
virtual void setViewport(const OdGsDCRect &screenRect)
virtual void cullingVolumeTransformBy(const OdGeMatrix3d &xfm)
virtual void flush()
OdGiRegenType m_regenerationType
Definition: GsViewImpl.h:805
virtual void propagateLayersChanges()
virtual void clearFrozenLayers()
const OdGePoint2d & dcUpperRight() const
Definition: GsViewImpl.h:477
OdGePoint3d m_position
Definition: GsViewImpl.h:750
virtual void roll(double rollAngle)
virtual void zoomExtents(const OdGePoint3d &minPt, const OdGePoint3d &maxPt)
double m_backClipDist
Definition: GsViewImpl.h:737
virtual OdGeVector3d upVector() const
virtual void freezeLayer(OdDbStub *layerID)
int m_nCachedDrawables
Definition: GsViewImpl.h:769
double getLinetypeGenerationCriteria() const
virtual OdGsViewPtr cloneView(bool cloneViewParameters=true, bool cloneGeometry=false)
OdGeMatrix3d perspectiveMatrix() const
virtual void viewParameters(OdGsView *pView) const
virtual void show()
virtual bool cullingVolumeIntersectWithOpt(const OdGsCullingPrimitive &prim) const
double actualFieldHeight() const
Definition: GsViewImpl.h:993
void invalidateRegion(const OdGiPathNode &path)
ODRX_DECLARE_MEMBERS(OdGsViewImpl)
OdGsPropertiesPtr getViewportPropertiesRoot() const
int lineweightToPixels(OdDb::LineWeight lineweight) const
double focalLength() const
void screenRect(OdGsDCPoint &lowerLeft, OdGsDCPoint &upperRight) const
virtual void select(const OdGsDCPoint *points, int numPoints, OdGsSelectionReactor *pReactor, SelectionMode mode=kCrossing)
OdMutex m_mtExtents
Definition: GsViewImpl.h:770
virtual bool isPerspective() const
const OdGeVector3d & getUpVector() const
Definition: GsViewImpl.h:397
bool m_screenInvertedY
Definition: GsViewImpl.h:739
virtual OdDbStub * visualStyle() const
virtual void setLensLength(double lensLength)
virtual void invalidate(const OdGsDCRect &rect)
virtual double lineweightToDcScale() const
virtual void hide()
const OdGsBaseVectorizeDevice * baseDevice() const
Definition: GsViewImpl.h:250
double m_linetypeAlternateScaleMultiplier
Definition: GsViewImpl.h:761
virtual void orbit(double xOrbit, double yOrbit)
double linetypeAlternateScaleMultiplier() const
virtual void getViewport(OdGsDCRect &screenRect) const
OdGePoint2d m_dcScreenMax
Definition: GsViewImpl.h:741
double actualFieldWidth() const
Definition: GsViewImpl.h:988
void setInversion(bool invertedX, bool invertedY)
virtual double lensLength() const
void setInvalid(bool bValue) const
Definition: GsViewImpl.h:877
void setRegenOnDrawForbidden(bool val)
Definition: GsViewImpl.h:958
virtual void setLegacyWireframeMode(bool bSet)
virtual void select(const OdGePoint2d *aPtDc, int numPoints, OdGsSelectionReactor *pReactor, SelectionMode mode=kCrossing)=0
virtual bool isVisible()
virtual bool add(OdGiDrawable *sceneGraph, OdGsModel *model)
const OdGePoint2d & dcScreenMax() const
Definition: GsViewImpl.h:475
ClearColor clearColor() const
const OdGsBaseModule * getGsModulePtr() const
Definition: GsViewImpl.h:841
virtual OdGsModelArray getModelList() const
OdDbStubPtrArray m_lastFrozenLayers
Definition: GsViewImpl.h:730
virtual void enableStereo(bool enabled)
virtual void getViewportBorderProperties(ODCOLORREF &color, int &width) const
virtual void zoom(double zoomFactor)
double m_lineweightToDcScale
Definition: GsViewImpl.h:762
virtual OdDbStub * background() const
OdGsCullingVolumePtr m_pCullingVolume
Definition: GsViewImpl.h:764
OdGeVector3d m_xVector
Definition: GsViewImpl.h:754
virtual void setLineweightToDcScale(double scale)
virtual void updateViewProps(bool bFullUpdate=true)
OdGeMatrix3d m_eyeToWorld
Definition: GsViewImpl.h:755
virtual RenderMode mode() const
virtual OdGeMatrix3d projectionMatrix() const
const OdUInt8Array & getLweightsEnum() const
Definition: GsViewImpl.h:472
OdGsNode * getRootNode(DrawableHolder &holder)
OdGeVector3d m_eyeVector
Definition: GsViewImpl.h:753
virtual void viewportClipRegion(OdIntArray &counts, OdGsDCPointArray &dcPts) const
virtual void init(OdGsBaseVectorizeDevice *pDevice, const OdGsClientViewInfo *pViewInfo=0, bool enableLayerVisibilityPerView=false)
virtual bool isSupportLegacyWireframeMode() const
const OdGeMatrix3d & worldToEyeMatrix() const
Definition: GsViewImpl.h:923
OdGiDrawablePtr m_pViewportTrans
Definition: GsViewImpl.h:775
OdGePoint2dArray m_nrcPoints
Definition: GsViewImpl.h:759
virtual void setLinetypeScaleMultiplier(double linetypeScaleMultiplier)
OdGePoint2d m_dcScreenMin
Definition: GsViewImpl.h:740
virtual bool loadClientViewState(OdGsFiler *pFiler)
OdDbStub * getViewportObjectId() const
Definition: GsViewImpl.h:244
void setCompletelyVisible(bool val)
Definition: GsViewImpl.h:973
virtual void dolly(double xDolly, double yDolly, double zDolly)
virtual bool usesDept(double *pMinDeptSupported=0, double *pMaxDeptSupported=0) const
OdGePoint2d m_dcLowerLeft
Definition: GsViewImpl.h:742
void screenRect(OdGePoint2d &lowerLeft, OdGePoint2d &upperRight) const
OdDbStub * m_pVisualStyleId
Definition: GsViewImpl.h:774
virtual void viewportClipRegion(OdIntArray &counts, OdGePoint2dArray &vertices) const
void registerOverlay(const OdGsModel *pModel)
bool hasViewport3dClipping() const
Definition: GsViewImpl.h:983
bool defaultLightingEnabled() const
Definition: GsViewImpl.h:887
virtual void pan(double xPan, double yPan)
bool isViewportOnScreen() const
virtual void setVisualStyle(OdDbStub *visualStyleId)
double lineweightToPixels(double lineweight) const
void onWorldToEyeChanged()
virtual void setClearColor(ClearColor color)
virtual void setViewport(const OdGsDCRectDouble &screenRec)
const OdGeVector3d & eyeVector() const
Definition: GsViewImpl.h:395
const OdGeVector3d & xVector() const
Definition: GsViewImpl.h:396
virtual bool loadViewState(OdGsFiler *pFiler)
void setCheckValid(bool bValue) const
Definition: GsViewImpl.h:867
virtual void invalidate()
virtual double frontClip() const
OdDbStub * m_pBackgroundId
Definition: GsViewImpl.h:773
static double lensLengthFromFOV(double fovAngle)
double getLinetypeScaleMultiplier() const
virtual bool isLegacyHiddenMode() const
OdGeMatrix3d projectionMatrix(OdUInt32 nIncludes, OdGsOverlayId nOverlay=kGsMainOverlay) const
bool isAccumulateVpChanges() const
Definition: GsViewImpl.h:963
GsViewOverlayDataContainer m_overlayData
Definition: GsViewImpl.h:797
OdGeMatrix3d worldToDeviceMatrix(OdGsOverlayId nOverlay) const
double calcDeviation(const OdGiDeviationType type, const OdGePoint3d &pt) const
OdUInt32 frozenLayers() const
Definition: GsViewImpl.h:299
virtual double fieldWidth() const
bool doPerspectivePt(OdGePoint3d &point) const
virtual void initCullingVolume()
virtual void setLineweightEnum(int numLineweights, const OdUInt8 *lineweights)
double m_lensLength
Definition: GsViewImpl.h:747
virtual void setStereoParameters(double magnitude, double parallax)
DefaultLightingType defaultLightingType() const
Definition: GsViewImpl.h:892
virtual bool sceneDept(double &zNear, double &zFar, OdGsOverlayId nOverlay) const
double m_linetypeScaleMultiplier
Definition: GsViewImpl.h:760
bool isInvalid() const
Definition: GsViewImpl.h:872
OdGsBaseVectorizeDevice * baseDevice()
Definition: GsViewImpl.h:249
virtual void getViewport(OdGePoint2d &lowerLeft, OdGePoint2d &upperRight) const
virtual bool isStereoEnabled() const
virtual bool isCullingVolumeInitialized() const
bool isRegenOnDrawForbidden() const
Definition: GsViewImpl.h:953
OdGsBaseVectorizeDevice * m_pDevice
Definition: GsViewImpl.h:799
OdSharedPtr< OdGiClipBoundaryWithAbstractData > m_p3dClip
Definition: GsViewImpl.h:765
bool isHelperView() const
Definition: GsViewImpl.h:836
virtual void setBackground(OdDbStub *backgroundId)
virtual bool sceneDept(double &zNear, double &zFar) const
int cachedDrawables() const
Definition: GsViewImpl.h:409
virtual bool isBackClipped() const
virtual void setView(const OdGePoint3d &position, const OdGePoint3d &target, const OdGeVector3d &upVector, double fieldWidth, double fieldHeight, Projection projection=kParallel)
virtual OdGeMatrix3d worldToDeviceMatrix() const
virtual bool pointInViewport(const OdGePoint2d &screenPoint) const
virtual void propagateInvalidVpFlag()
virtual void beginInteractivity(double frameRateInHz)
OdIntPtr drawablesFilterFunction() const
virtual bool erase(OdGiDrawable *sceneGraph)
virtual double fieldHeight() const
virtual void zoomWindow(const OdGePoint2d &lowerLeft, const OdGePoint2d &upperRight)
OdGePoint3d m_target
Definition: GsViewImpl.h:751
bool setModeOverride(RenderMode mode)
virtual void setBackClip(double distance)
virtual void getSnapShot(OdGiRasterImagePtr &pImage, const OdGsDCRect &region)
RenderMode m_renderMode
Definition: GsViewImpl.h:810
OdIntArray m_nrcCounts
Definition: GsViewImpl.h:758
double unrotatedFieldHeight() const
virtual void setVisualStyle(const OdGiVisualStyle &visualStyle)
virtual const OdGiClipBoundary * viewport3dClipping(const OdGiAbstractClipBoundary **ppClipInfo=NULL) const
OdGsCullingVolumePtr cullingVolume() const
virtual OdGsCullingVolume::IntersectionStatus cullingVolumeIntersectWith(const OdGsCullingPrimitive &prim) const
OdRxObjectPtr m_pGsReserved
Definition: GsViewImpl.h:807
virtual void setLegacyHiddenMode(bool bSet)
double m_fieldWidth
Definition: GsViewImpl.h:745
virtual void eraseAll()
virtual void setViewport(const OdGePoint2d &lowerLeft, const OdGePoint2d &upperRight)
virtual bool extentsInView(const OdGePoint3d &minPt, const OdGePoint3d &maxPt) const
virtual bool isFrontClipped() const
OdGeMatrix3d objectToDeviceMatrix(OdGsOverlayId nOverlay) const
OdGsBaseModulePtr m_pModule
Definition: GsViewImpl.h:729
virtual void clearLinetypeCache()=0
bool updateViewportProperties(OdUInt32 incFlags)
double m_eyeVecLength
Definition: GsViewImpl.h:748
virtual void getViewport(OdGsDCRectDouble &screenRec) const
void setSnapping(bool val)
Definition: GsViewImpl.h:948
virtual void setViewportClipRegion(int numContours, int const *numVertices, OdGsDCPoint const *vertices)
void frozenLayers(OdDbStubPtrArray &frozenLayers) const
Definition: GsViewImpl.h:310
OdGeVector3d m_upVector
Definition: GsViewImpl.h:752
virtual void thawLayer(OdDbStub *layerID)
static OdGsViewImpl * safeCast(OdGsView *pView)
Definition: GsViewImpl.h:933
int m_borderWeight
Definition: GsViewImpl.h:735
short viewportRotation() const
double m_frontClipDist
Definition: GsViewImpl.h:736
virtual void setEnableFrontClip(bool enable)
bool m_screenInvertedX
Definition: GsViewImpl.h:738
virtual int partialUpdateExtentsEnlargement() const
bool doInversePerspectivePt(OdGePoint3d &point) const
OdGiClipBoundaryWithAbstractData * viewport3dClippingObject()
Definition: GsViewImpl.h:978
OdDbStubPtrArray m_frozenLayers
Definition: GsViewImpl.h:814
bool isValidViewportId(const OdUInt32 vpId) const
OdGiRegenType getRegenType() const
Definition: GsViewImpl.h:388
virtual bool isLegacyWireframeMode() const
virtual bool isInInteractivity() const
virtual void setMode(RenderMode mode)
bool isSnapping() const
Definition: GsViewImpl.h:943
virtual double backClip() const
static double lensLengthToFOV(double lensLength)
OdGsPropertiesPtr m_pProperties
Definition: GsViewImpl.h:772
void initDeviation()
virtual void setViewportClipRegion(int numContours, const int *numVertices, const OdGePoint2d *vertices)
virtual void setPlotTransparency(bool bSet)
virtual void setViewport3dClipping(const OdGiClipBoundary *pBoundary, const OdGiAbstractClipBoundary *pClipInfo=NULL)
virtual OdGeMatrix3d viewingMatrix() const
void viewportDcCorners(OdGePoint2d &lower_left, OdGePoint2d &upper_right) const
virtual void enableDefaultLighting(bool bEnable, DefaultLightingType lightType=kTwoLights)
void onFinalRelease()
virtual bool isViewportBorderVisible() const
DrawableHolderArray m_drawables
Definition: GsViewImpl.h:812
bool isDependentGeometryView() const
Definition: GsViewImpl.h:831
bool isCheckValid() const
Definition: GsViewImpl.h:862
OdGeMatrix3d eyeToScreenMatrix(OdGsOverlayId nOverlay=kGsMainOverlay) const
virtual bool saveClientViewState(OdGsFiler *pFiler) const
virtual bool viewExtents(OdGeBoundBlock3d &extents) const =0
virtual OdGsModel * getModel(const OdGiDrawable *pDrawable) const
virtual void setViewportBorderVisibility(bool visible)
void invalidateCachedViewportGeometry(OdUInt32 mask)
bool isRotated() const
Definition: GsViewImpl.h:902
OdGsPropertiesPtr getViewportPropertiesForType(OdGsProperties::PropertiesType type) const
virtual void getStereoParameters(double &magnitude, double &parallax) const
bool isCompletelyVisible() const
Definition: GsViewImpl.h:968
const OdGePoint2d & dcLowerLeft() const
Definition: GsViewImpl.h:476
OdUInt32 m_gsViewImplFlags
Definition: GsViewImpl.h:733
const OdGeMatrix3d & rotationMatrix() const
virtual void invalidate(const OdGeExtents3d &worldExt, const OdGsModel *pModel, OdDb::LineWeight extendByLineweight=OdDb::kLnWt000)
void setCullingVolume(OdGsCullingVolumePtr newVol)
double unrotatedFieldWidth() const
virtual void clientViewInfo(OdGsClientViewInfo &viewInfo) const
virtual void setFrontClip(double distance)
bool isNonRectClipped() const
Definition: GsViewImpl.h:897
void unregisterOverlay(const OdGsModel *pModel)
virtual void setViewportBorderProperties(ODCOLORREF color, int width)
virtual double linetypeScaleMultiplier() const
bool isNull() const
Definition: SharedPtr.h:163
T * get()
Definition: SharedPtr.h:134
const T * get() const
Definition: SmartPtr.h:326
GLint GLenum GLsizei width
Definition: gles2_ext.h:110
GLenum GLint GLuint mask
Definition: gles2_ext.h:262
GLuint GLsizei GLsizei GLint GLenum * type
Definition: gles2_ext.h:274
@ kCrossing
Definition: DbTableStyle.h:70
LineWeight
Definition: OdaDefs.h:384
@ kLnWt000
Definition: OdaDefs.h:385
OdUInt32 viewportFlags
Definition: Gs.h:1034
@ kDependentViewport
Definition: Gs.h:1024
@ kDependentGeometry
Definition: Gs.h:1025
OdGiContextualColorsPtr contextColors
Definition: Gs.h:1033