CFx SDK Documentation  2020SP3
FxView.h
Go to the documentation of this file.
1 //
2 // (C) Copyright 2005-2020 by Graebert GmbH.
3 //
4 // Permission to use, copy, modify, and distribute this software in
5 // object code form for any purpose and without fee is hereby granted,
6 // provided that the above copyright notice appears in all copies and
7 // that both that copyright notice and the limited warranty and
8 // restricted rights notice below appear in all supporting
9 // documentation.
10 //
11 // GRAEBERT PROVIDES THIS PROGRAM "AS IS" AND WITH ALL FAULTS.
12 // GRAEBERT SPECIFICALLY DISCLAIMS ANY IMPLIED WARRANTY OF
13 // MERCHANTABILITY OR FITNESS FOR A PARTICULAR USE. GRAEBERT GMBH
14 // DOES NOT WARRANT THAT THE OPERATION OF THE PROGRAM WILL BE
15 // UNINTERRUPTED OR ERROR FREE.
16 
17 #pragma once
18 
19 #include "FxPragmaPush.h"
20 
21 #include <DbObjectId.h>
22 #include "DDKERNEL.h"
23 #include "FxPicture.h"
24 
25 #include <Gi/GiCommonDraw.h>
26 #include <Ge/GeExtents3d.h>
27 #include <Ge/GeBoundBlock3d.h>
28 #include <DbViewport.h>
29 
30 class OdEdCommandContext;
31 class CFxGsNode;
32 class CFxSelectionSet;
33 class CFxViewDrawContext;
34 class CFxVectorizeDevice;
35 class CFxView;
36 class CFxViewReactor;
37 class CFxViewDrawInfo;
38 
39 class QPainterPath;
40 class OdDbViewport;
41 
48 {
49 public:
51 
60  bool InitializeFromView( const CFxView* pView );
61 
70  bool InitializeFromViewInfo( const CFxViewDrawInfo* pViewInfo );
71 
78  void ApplyToView( CFxView* pView );
79 
86  const OdGePoint3d& GetPosition() const
87  {
88  return m_position;
89  }
90 
97  const OdGePoint3d& GetTarget() const
98  {
99  return m_target;
100  }
101 
108  const OdGeVector3d& GetEyeVector() const
109  {
110  return m_eyeVector;
111  }
112 
119  const OdGeVector3d& GetUpVector() const
120  {
121  return m_upVector;
122  }
123 
130  double GetFieldWidth() const
131  {
132  return m_fieldWidth;
133  }
134 
141  double GetFieldHeight() const
142  {
143  return m_fieldHeight;
144  }
145 
152  double GetPixelWidth() const
153  {
154  return m_dPixelWidth;
155  }
156 
163  double GetPixelHeight() const
164  {
165  return m_dPixelHeight;
166  }
167 
174  double GetFocalLength() const
175  {
176  return m_focalLength;
177  }
178 
186  {
187  return m_WorldToEye;
188  }
189 
191  {
192  return m_VisibleRect;
193  }
194 
203  static bool IsViewSettingsValid( const OdGsView* pView );
204 
213  static bool IsViewSettingsValid( const OdDbViewport* pViewport );
214 
223  static bool IsViewExtentsValid( const OdGeExtents3d& extents );
224 
225 /*
226  static bool IsViewSettingsValid(
227  const OdGePoint3d& position,
228  const OdGePoint3d& target,
229  const OdGeVector3d& upVector,
230  double fieldWidth,
231  double fieldHeight );
232 */
234  double iWidthInPixels,
235  double iHeighInPixels,
236  const OdGePoint3d& point,
237  bool bUsePerspective) const;
238 
239 private:
240  OdGePoint3d m_position;
241  OdGePoint3d m_target;
242  OdGeVector3d m_eyeVector;
243  OdGeVector3d m_upVector;
244  double m_fieldWidth;
245  double m_fieldHeight;
246  double m_focalLength;
247 
248  double m_dPixelWidth;
249  double m_dPixelHeight;
250 
251  OdGeMatrix3d m_WorldToEye;
252 
253  OdGsDCRectDouble m_VisibleRect;
254  static bool m_bEvent;
255 };
256 
257 typedef std::vector<CFxViewportSnapShot> VIEWPORTDATA_VECTOR;
258 
265 {
266 public:
267 
270 
272  ~CFxView() override;
273 
275 
280  virtual const CFxVectorizeDevice* GetFxVectorizeDevice() const = 0;
281 
286 
291  virtual const QPainterPath& GetViewportInternalRegion() const = 0;
292 
297  virtual const QPainterPath& GetViewportExternalRegion() const = 0;
298 
302  virtual const OdGePoint3dArray& GetViewportInternalRegionWCS() const = 0;
303 
307  virtual const OdGePoint3dArray& GetViewportExternalRegionWCS() const = 0;
308 
313  virtual bool IsOverall() const = 0;
314 
319  virtual bool IsPaperSpaceOverall() const = 0;
320 
325  virtual bool IsActive() const = 0;
326 
331  virtual bool SetPreviousData() = 0;
332 
337  virtual void StartTransaction() = 0;
338 
343  virtual void EndTransaction() = 0;
344 
349  virtual bool InsideTransaction() const = 0;
350 
354  virtual int PointToWCS( const OdGsDCPoint& pointSCS, const OdGePlane& plane, OdGePoint3d& pointWCS ) const = 0;
355  virtual int PointToWCS( const CFxPointF& pointSCS, const OdGePlane& plane, OdGePoint3d& pointWCS ) const = 0;
356 
360  virtual int PointToWCSOnUCS( const OdGsDCPoint& pointSCS, OdGePoint3d& pointWCS ) const = 0;
361 
365  virtual int PointToWCSOnUCS( const OdGePoint3d& pointSCS, OdGePoint3d& pointWCS ) const = 0;
366 
370  virtual int PointToWCSOnUCS( const OdGePoint2d& pointSCS, OdGePoint3d& pointWCS ) const = 0;
371 
375  virtual void PointToSCS( const OdGePoint3d& pointWCS, OdGsDCPoint& pointSCS ) const = 0;
376 
380  virtual void PointToSCS( const OdGePoint3d& pointWCS, CFxPoint& pointSCS ) const = 0;
381 
385  virtual void PointToSCS( const OdGePoint3d& pointWCS, CFxPointF& pointSCS ) const = 0;
386 
390  virtual int PointToView( const OdGsDCPoint& pointSCS, OdGePoint2d& viewPt ) const = 0;
391 
395  virtual int PointToView( const OdGePoint2d& pointSCS, OdGePoint2d& viewPt ) const = 0;
396 
400  virtual OdGeMatrix3d EyeToPaperSpace() const = 0;
401 
403 
407  virtual OdGeMatrix3d PaperSpaceToEye() const = 0;
408 
410 
418 
423  virtual OdInt16 GetCadWindowId() const = 0;
424 
429  virtual const CFxViewportSnapShot* GetPreviousViewSettings() const = 0;
430 
435  virtual void AddViewReactor( CFxViewReactor* pReactor ) = 0;
436 
441  virtual void RemoveViewReactor( CFxViewReactor* pReactor ) = 0;
442 
447  virtual void SetElevation( double dElev ) = 0;
448 
453  virtual double Elevation() const = 0;
454 
459  virtual bool IsRectangular() const = 0;
460 
465  virtual bool ViewExtentsWCS( OdGeBoundBlock3d& extents ) const = 0;
466 
471  virtual bool ZoomExtentsWCS( const OdGeBoundBlock3d* pExtents ) = 0;
472 
477  virtual void EnterDragMode() = 0;
478 
483  virtual bool IsDragging() const = 0;
484 
489  virtual void LeaveDragMode() = 0;
490 
495  virtual OdGeExtents3d GetRealExtents(volatile bool *abortFlag = 0) const = 0;
496 
501  virtual bool GetGeomExtents( OdGeBoundBlock3d& bounds, volatile bool *abortFlag = 0 ) const = 0;
502 
505  virtual void SetPanMode( bool bVal ) = 0;
506 
507  virtual bool IsPanMode() const = 0;
508 
511  virtual void SetZoomMode( bool bVal ) = 0;
512 
513  virtual bool IsZoomMode() const = 0;
514 
517  virtual void SetOrbitMode( bool bVal ) = 0;
518 
519  virtual bool IsOrbitMode() const = 0;
520 
521  virtual bool IsPreviousVectorizationAborted() const = 0;
524  virtual OdGeVector3d viewDir() const = 0;
525 
528  virtual double focalLength() const = 0;
529 
533 
537 
540  virtual OdGeMatrix3d getEyeToScreenMatrix() const = 0;
541 
544  virtual double GetDeviation(const OdGiDeviationType deviationType, const OdGePoint3d& pointOnCurve) const = 0;
545 
548  virtual void screenRect(OdGsDCPoint &lowerLeft, OdGsDCPoint &upperRight) const = 0;
549 
552  virtual void screenRect(OdGePoint2d &lowerLeft, OdGePoint2d &upperRight) const = 0;
553 
556  virtual OdGsDCRectDouble visibleScreenRect() const = 0;
557 
561 
564  virtual double screenWidth() const = 0;
565 
568  virtual double screenHeight() const = 0;
569 
572  virtual double visibleWidth() const = 0;
573 
576  virtual double visibleHeight() const = 0;
577 
580  virtual OdDbStub* viewportObjectId() const = 0;
581 
584  virtual const CFxPicture& GetFxPicture() const = 0;
585 
588  virtual CFxPicture& GetFxPicture() = 0;
589 
593 
596  virtual size_t numDrawables() const = 0;
597 
600  virtual OdGiDrawablePtr drawableAt( size_t iIndex ) const = 0;
601 
605  virtual bool IsFieldAspectMaintained() const = 0;
606 
609  virtual void SetFieldAspectMaintained(bool) = 0;
610 };
611 
612 class OdDbPlotSettings;
613 
618 
620 
621 #include "FxPragmaPop.h"
CFxView::GetViewportExternalRegionWCS
virtual const OdGePoint3dArray & GetViewportExternalRegionWCS() const =0
CFxViewportSnapShot::GetPosition
const OdGePoint3d & GetPosition() const
Definition: FxView.h:86
CFxView::SetElevation
virtual void SetElevation(double dElev)=0
FxPragmaPop.h
CFxView::SetPanMode
virtual void SetPanMode(bool bVal)=0
CFxView::IsDragging
virtual bool IsDragging() const =0
OdGePlane
Definition: GePlane.h:45
CFxView::PointToSCS
virtual void PointToSCS(const OdGePoint3d &pointWCS, CFxPointF &pointSCS) const =0
OdGeVector3d
Definition: GeVector3d.h:54
CFxView::screenWidth
virtual double screenWidth() const =0
CFxViewportSnapShot::GetTarget
const OdGePoint3d & GetTarget() const
Definition: FxView.h:97
CFxView::visibleScreenRectInViewCoordinates
virtual OdGsDCRectDouble visibleScreenRectInViewCoordinates() const =0
CFxView::focalLength
virtual double focalLength() const =0
CFxViewportSnapShot::GetUpVector
const OdGeVector3d & GetUpVector() const
Definition: FxView.h:119
VIEWPORTDATA_VECTOR
std::vector< CFxViewportSnapShot > VIEWPORTDATA_VECTOR
Definition: FxView.h:257
GetPaperProperties
DDKERNEL_API void GetPaperProperties(OdDbPlotSettings *pLayout, OdGePoint3dArray &points, OdGePoint3dArray &margins)
OdGsView
Definition: Gs.h:133
OdGsDCRectDouble
Definition: GsDefs.h:242
CFxView::IsOverall
virtual bool IsOverall() const =0
CFxView::PointToSCS
virtual void PointToSCS(const OdGePoint3d &pointWCS, OdGsDCPoint &pointSCS) const =0
CFxView::IsPanMode
virtual bool IsPanMode() const =0
CFxViewportSnapShot::InitializeFromViewInfo
bool InitializeFromViewInfo(const CFxViewDrawInfo *pViewInfo)
CFxView::EndTransaction
virtual void EndTransaction()=0
CFxView::numDrawables
virtual size_t numDrawables() const =0
CFxSelectionSet
Definition: FxSelectionSet.h:49
OdDbObjectId
Definition: DbObjectId.h:99
CFxViewportSnapShot::GetEyeVector
const OdGeVector3d & GetEyeVector() const
Definition: FxView.h:108
GeExtents3d.h
CFxView::GetViewportExternalRegion
virtual const QPainterPath & GetViewportExternalRegion() const =0
CFxView::ViewExtentsWCS
virtual bool ViewExtentsWCS(OdGeBoundBlock3d &extents) const =0
CFxPicture
Definition: FxPicture.h:37
CFxViewDrawInfo
Definition: FxViewDrawInfo.h:47
CFxView::Elevation
virtual double Elevation() const =0
GetActiveFxView
DDKERNEL_API CFxView * GetActiveFxView(OdEdCommandContext *pCmdCtx)
CFxView::viewDir
virtual OdGeVector3d viewDir() const =0
OdGsDCPoint
Definition: GsDefs.h:53
DDKERNEL.h
OdArray< OdGePoint3d, OdMemoryAllocator< OdGePoint3d > >
GeBoundBlock3d.h
CFxPointF
#define CFxPointF
Definition: FxPlatformSettings.h:73
FxPicture.h
CFxView::GetFxVectorizeDevice
virtual const CFxVectorizeDevice * GetFxVectorizeDevice() const =0
CFxView::getEyeToWorldTransform
virtual OdGeMatrix3d getEyeToWorldTransform() const =0
CFxView::IsOrbitMode
virtual bool IsOrbitMode() const =0
CFxViewportSnapShot::GetVisibleRect
const OdGsDCRectDouble & GetVisibleRect() const
Definition: FxView.h:190
OdGeMatrix3d
Definition: GeMatrix3d.h:73
OdInt16
short OdInt16
Definition: OdPlatformSettings.h:756
CFxView::getWorldToEyeTransform
virtual OdGeMatrix3d getWorldToEyeTransform() const =0
CFxView::IsFieldAspectMaintained
virtual bool IsFieldAspectMaintained() const =0
CFxView::SetZoomMode
virtual void SetZoomMode(bool bVal)=0
CFxVectorizeDevice
Definition: FxVectorizeDevice.h:42
CFxView::GetViewportInternalRegion
virtual const QPainterPath & GetViewportInternalRegion() const =0
CFxView::EyeToPaperSpace
static OdGeMatrix3d EyeToPaperSpace(OdDbObjectId idViewport)
CFxViewDrawContext
Definition: FxViewDrawContext.h:39
CFxViewportSnapShot::GetNumPixelsInUnitSquare
OdGePoint2d GetNumPixelsInUnitSquare(double iWidthInPixels, double iHeighInPixels, const OdGePoint3d &point, bool bUsePerspective) const
CFxView::IsPaperSpaceOverall
virtual bool IsPaperSpaceOverall() const =0
CFxView::PointToWCSOnUCS
virtual int PointToWCSOnUCS(const OdGePoint2d &pointSCS, OdGePoint3d &pointWCS) const =0
OdSmartPtr< OdGiDrawable >
CFxView::drawableAt
virtual OdGiDrawablePtr drawableAt(size_t iIndex) const =0
OdGePoint3d
Definition: GePoint3d.h:55
CFxViewportSnapShot::GetFieldHeight
double GetFieldHeight() const
Definition: FxView.h:141
CFxPoint
#define CFxPoint
Definition: FxPlatformSettings.h:75
CFxView::IsRectangular
virtual bool IsRectangular() const =0
OdEdCommandContext
Definition: EdCommandContext.h:42
OdDbPlotSettings
Definition: DbPlotSettings.h:41
CFxView::~CFxView
~CFxView() override
DbObjectId.h
CFxView::GetRealExtents
virtual OdGeExtents3d GetRealExtents(volatile bool *abortFlag=0) const =0
CFxView::SetPreviousData
virtual bool SetPreviousData()=0
CFxView::PaperSpaceToEye
virtual OdGeMatrix3d PaperSpaceToEye() const =0
CFxView::PointToSCS
virtual void PointToSCS(const OdGePoint3d &pointWCS, CFxPoint &pointSCS) const =0
CFxView::IsActive
virtual bool IsActive() const =0
CFxView::visibleScreenRect
virtual OdGsDCRectDouble visibleScreenRect() const =0
CFxView::PaperSpaceToEye
static OdGeMatrix3d PaperSpaceToEye(OdDbObjectId idViewport)
CFxView::GetGeomExtents
virtual bool GetGeomExtents(OdGeBoundBlock3d &bounds, volatile bool *abortFlag=0) const =0
OdDbViewport
Definition: DbViewport.h:49
GiCommonDraw.h
DDKERNEL_API
#define DDKERNEL_API
Definition: DDKERNEL.h:32
CFxViewportSnapShot::CFxViewportSnapShot
CFxViewportSnapShot()
CFxView::PointToView
virtual int PointToView(const OdGsDCPoint &pointSCS, OdGePoint2d &viewPt) const =0
CFxView::viewportObjectId
virtual OdDbStub * viewportObjectId() const =0
CFxView::ODRX_DECLARE_MEMBERS
ODRX_DECLARE_MEMBERS(CFxView)
CFxView
Definition: FxView.h:265
CFxView::GetDeviation
virtual double GetDeviation(const OdGiDeviationType deviationType, const OdGePoint3d &pointOnCurve) const =0
CFxViewportSnapShot::GetPixelWidth
double GetPixelWidth() const
Definition: FxView.h:152
CFxView::InsideTransaction
virtual bool InsideTransaction() const =0
CFxView::screenRect
virtual void screenRect(OdGePoint2d &lowerLeft, OdGePoint2d &upperRight) const =0
CFxView::screenRect
virtual void screenRect(OdGsDCPoint &lowerLeft, OdGsDCPoint &upperRight) const =0
CFxView::GetFxVectorizeDevice
virtual CFxVectorizeDevice * GetFxVectorizeDevice()=0
CFxView::PointToWCS
virtual int PointToWCS(const OdGsDCPoint &pointSCS, const OdGePlane &plane, OdGePoint3d &pointWCS) const =0
OdGiDeviationType
OdGiDeviationType
Definition: GiCommonDraw.h:64
OdGeBoundBlock3d
Definition: GeBoundBlock3d.h:43
CFxView::AddViewReactor
virtual void AddViewReactor(CFxViewReactor *pReactor)=0
CFxView::IsZoomMode
virtual bool IsZoomMode() const =0
CFxView::GetCadWindowId
virtual OdInt16 GetCadWindowId() const =0
CFxViewportSnapShot
Definition: FxView.h:48
DbViewport.h
CFxViewportSnapShot::GetPixelHeight
double GetPixelHeight() const
Definition: FxView.h:163
CFxView::GetPreviousViewSettings
virtual const CFxViewportSnapShot * GetPreviousViewSettings() const =0
CFxView::PointToWCS
virtual int PointToWCS(const CFxPointF &pointSCS, const OdGePlane &plane, OdGePoint3d &pointWCS) const =0
CFxView::CFxView
CFxView()
CFxView::GetCorrectionScreenMatrix
virtual OdGeMatrix3d GetCorrectionScreenMatrix() const =0
CFxView::WorldToView
static OdGeMatrix3d WorldToView(OdDbObjectId id)
OdGeExtents3d
Definition: GeExtents3d.h:45
CFxViewportSnapShot::IsViewSettingsValid
static bool IsViewSettingsValid(const OdDbViewport *pViewport)
CFxView::SetOrbitMode
virtual void SetOrbitMode(bool bVal)=0
CFxViewportSnapShot::GetWorldToEyeMatrix
const OdGeMatrix3d & GetWorldToEyeMatrix() const
Definition: FxView.h:185
CFxView::ZoomExtentsWCS
virtual bool ZoomExtentsWCS(const OdGeBoundBlock3d *pExtents)=0
CFxViewportSnapShot::IsViewSettingsValid
static bool IsViewSettingsValid(const OdGsView *pView)
CFxView::IsPreviousVectorizationAborted
virtual bool IsPreviousVectorizationAborted() const =0
CFxView::getEyeToScreenMatrix
virtual OdGeMatrix3d getEyeToScreenMatrix() const =0
CFxView::PointToView
virtual int PointToView(const OdGePoint2d &pointSCS, OdGePoint2d &viewPt) const =0
CFxViewReactor
Definition: FxViewReactor.h:31
FxPragmaPush.h
CFxView::EyeToPaperSpace
virtual OdGeMatrix3d EyeToPaperSpace() const =0
CFxView::visibleHeight
virtual double visibleHeight() const =0
CFxView::LeaveDragMode
virtual void LeaveDragMode()=0
CFxView::GetFxPicture
virtual CFxPicture & GetFxPicture()=0
CFxViewportSnapShot::GetFocalLength
double GetFocalLength() const
Definition: FxView.h:174
CFxViewportSnapShot::InitializeFromView
bool InitializeFromView(const CFxView *pView)
CFxView::visibleWidth
virtual double visibleWidth() const =0
CFxView::StartTransaction
virtual void StartTransaction()=0
CFxView::SetFieldAspectMaintained
virtual void SetFieldAspectMaintained(bool)=0
CFxView::GetFxPicture
virtual const CFxPicture & GetFxPicture() const =0
CFxViewportSnapShot::IsViewExtentsValid
static bool IsViewExtentsValid(const OdGeExtents3d &extents)
CFxView::EnterDragMode
virtual void EnterDragMode()=0
CFxView::screenHeight
virtual double screenHeight() const =0
CFxViewportSnapShot::GetFieldWidth
double GetFieldWidth() const
Definition: FxView.h:130
CFxViewportSnapShot::ApplyToView
void ApplyToView(CFxView *pView)
CFxView::RemoveViewReactor
virtual void RemoveViewReactor(CFxViewReactor *pReactor)=0
CFxView::PointToWCSOnUCS
virtual int PointToWCSOnUCS(const OdGePoint3d &pointSCS, OdGePoint3d &pointWCS) const =0
CFxView::PointToWCSOnUCS
virtual int PointToWCSOnUCS(const OdGsDCPoint &pointSCS, OdGePoint3d &pointWCS) const =0
CFxView::GetViewportInternalRegionWCS
virtual const OdGePoint3dArray & GetViewportInternalRegionWCS() const =0
OdGePoint2d
Definition: GePoint2d.h:60