CFx SDK Documentation 2024 SP0
Loading...
Searching...
No Matches
FxView.h
Go to the documentation of this file.
1//
2// (C) Copyright 2005-2023 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#include <vector>
31
33class CFxGsNode;
34class CFxSelectionSet;
37class CFxView;
38class CFxViewReactor;
39class CFxViewDrawInfo;
40
41class QPainterPath;
42class OdDbViewport;
43
44using ViewportKey = int;
45static constexpr ViewportKey NullViewportKey = 0;
46
53{
54public:
56
65 bool InitializeFromView( const CFxView* pView );
66
75 bool InitializeFromViewInfo( const CFxViewDrawInfo* pViewInfo );
76
83 void ApplyToView( CFxView* pView );
84
91 const OdGePoint3d& GetPosition() const
92 {
93 return m_position;
94 }
95
102 const OdGePoint3d& GetTarget() const
103 {
104 return m_target;
105 }
106
114 {
115 return m_eyeVector;
116 }
117
125 {
126 return m_upVector;
127 }
128
135 double GetFieldWidth() const
136 {
137 return m_fieldWidth;
138 }
139
146 double GetFieldHeight() const
147 {
148 return m_fieldHeight;
149 }
150
157 double GetPixelWidth() const
158 {
159 return m_dPixelWidth;
160 }
161
168 double GetPixelHeight() const
169 {
170 return m_dPixelHeight;
171 }
172
179 double GetFocalLength() const
180 {
181 return m_focalLength;
182 }
183
191 {
192 return m_WorldToEye;
193 }
194
196 {
197 return m_VisibleRect;
198 }
199
208 static bool IsViewSettingsValid( const OdGsView* pView );
209
218 static bool IsViewSettingsValid( const OdDbViewport* pViewport );
219
228 static bool IsViewExtentsValid( const OdGeExtents3d& extents );
229
230/*
231 static bool IsViewSettingsValid(
232 const OdGePoint3d& position,
233 const OdGePoint3d& target,
234 const OdGeVector3d& upVector,
235 double fieldWidth,
236 double fieldHeight );
237*/
239 double iWidthInPixels,
240 double iHeighInPixels,
241 const OdGePoint3d& point,
242 bool bUsePerspective) const;
243
244private:
245 OdGePoint3d m_position;
246 OdGePoint3d m_target;
247 OdGeVector3d m_eyeVector;
248 OdGeVector3d m_upVector;
249 double m_fieldWidth;
250 double m_fieldHeight;
251 double m_focalLength;
252
253 double m_dPixelWidth;
254 double m_dPixelHeight;
255
256 OdGeMatrix3d m_WorldToEye;
257
258 OdGsDCRectDouble m_VisibleRect;
259 static bool m_bEvent;
260};
261
262typedef std::vector<CFxViewportSnapShot> VIEWPORTDATA_VECTOR;
263
270{
271public:
272
275
277 ~CFxView() override;
278
280
285 virtual const CFxVectorizeDevice* GetFxVectorizeDevice() const = 0;
286
291
296 virtual const QPainterPath& GetViewportInternalRegion() const = 0;
297
302 virtual const QPainterPath& GetViewportExternalRegion() const = 0;
303
308
313
318 virtual bool IsOverall() const = 0;
319
324 virtual bool IsPaperSpaceOverall() const = 0;
325
330 virtual bool IsActive() const = 0;
331
336 virtual bool SetPreviousData() = 0;
337
342 virtual void StartTransaction() = 0;
343
348 virtual void EndTransaction() = 0;
349
354 virtual bool InsideTransaction() const = 0;
355
359 virtual int PointToWCS( const OdGsDCPoint& pointSCS, const OdGePlane& plane, OdGePoint3d& pointWCS ) const = 0;
360 virtual int PointToWCS( const CFxPointF& pointSCS, const OdGePlane& plane, OdGePoint3d& pointWCS ) const = 0;
361
365 virtual int PointToWCSOnUCS( const OdGsDCPoint& pointSCS, OdGePoint3d& pointWCS ) const = 0;
366
370 virtual int PointToWCSOnUCS( const OdGePoint3d& pointSCS, OdGePoint3d& pointWCS ) const = 0;
371
375 virtual int PointToWCSOnUCS( const OdGePoint2d& pointSCS, OdGePoint3d& pointWCS ) const = 0;
376
380 virtual void PointToSCS( const OdGePoint3d& pointWCS, OdGsDCPoint& pointSCS ) const = 0;
381
385 virtual void PointToSCS( const OdGePoint3d& pointWCS, CFxPoint& pointSCS ) const = 0;
386
390 virtual void PointToSCS( const OdGePoint3d& pointWCS, CFxPointF& pointSCS ) const = 0;
391
395 virtual int PointToView( const OdGsDCPoint& pointSCS, OdGePoint2d& viewPt ) const = 0;
396
400 virtual int PointToView( const OdGePoint2d& pointSCS, OdGePoint2d& viewPt ) const = 0;
401
405 virtual OdGeMatrix3d EyeToPaperSpace() const = 0;
406
408
412 virtual OdGeMatrix3d PaperSpaceToEye() const = 0;
413
415
423
428 virtual ViewportKey GetVpNum() const = 0;
429
434 virtual OdInt16 GetCadWindowId() const = 0;
435
441
446 virtual void AddViewReactor( CFxViewReactor* pReactor ) = 0;
447
452 virtual void RemoveViewReactor( CFxViewReactor* pReactor ) = 0;
453
458 virtual void SetElevation( double dElev ) = 0;
459
464 virtual double Elevation() const = 0;
465
470 virtual bool IsRectangular() const = 0;
471
476 virtual bool ViewExtentsWCS( OdGeBoundBlock3d& extents ) const = 0;
477
482 virtual bool ZoomExtentsWCS( const OdGeBoundBlock3d* pExtents ) = 0;
483
488 virtual void EnterDragMode() = 0;
489
494 virtual bool IsDragging() const = 0;
495
500 virtual void LeaveDragMode() = 0;
501
506 virtual OdGeExtents3d GetRealExtents(volatile bool *abortFlag = 0) const = 0;
507
512 virtual bool GetGeomExtents( OdGeBoundBlock3d& bounds, volatile bool *abortFlag = 0 ) const = 0;
513
516 virtual void SetPanMode( bool bVal ) = 0;
517
518 virtual bool IsPanMode() const = 0;
519
522 virtual void SetZoomMode( bool bVal ) = 0;
523
524 virtual bool IsZoomMode() const = 0;
525
528 virtual void SetOrbitMode( bool bVal ) = 0;
529
530 virtual bool IsOrbitMode() const = 0;
531
532 virtual bool IsPreviousVectorizationAborted() const = 0;
535 virtual OdGeVector3d viewDir() const = 0;
536
539 virtual double focalLength() const = 0;
540
544
548
552
555 virtual double GetDeviation(const OdGiDeviationType deviationType, const OdGePoint3d& pointOnCurve) const = 0;
556
559 virtual void screenRect(OdGsDCPoint &lowerLeft, OdGsDCPoint &upperRight) const = 0;
560
563 virtual void screenRect(OdGePoint2d &lowerLeft, OdGePoint2d &upperRight) const = 0;
564
568
572
575 virtual double screenWidth() const = 0;
576
579 virtual double screenHeight() const = 0;
580
583 virtual double visibleWidth() const = 0;
584
587 virtual double visibleHeight() const = 0;
588
591 virtual OdDbStub* viewportObjectId() const = 0;
592
596
599 virtual size_t numDrawables() const = 0;
600
603 virtual OdGiDrawablePtr drawableAt( size_t iIndex ) const = 0;
604
608 virtual bool IsFieldAspectMaintained() const = 0;
609
612 virtual void SetFieldAspectMaintained(bool) = 0;
613};
614
615class OdDbPlotSettings;
616
621
623
624#include "FxPragmaPop.h"
#define DDKERNEL_API
Definition: DDKERNEL.h:32
#define CFxPointF
#define CFxPoint
DDKERNEL_API void GetPaperProperties(OdDbPlotSettings *pLayout, OdGePoint3dArray &points, OdGePoint3dArray &margins)
std::vector< CFxViewportSnapShot > VIEWPORTDATA_VECTOR
Definition: FxView.h:262
DDKERNEL_API CFxView * GetActiveFxView(OdEdCommandContext *pCmdCtx)
int ViewportKey
Definition: FxView.h:44
OdGiDeviationType
Definition: GiCommonDraw.h:65
short OdInt16
virtual OdGsDCRectDouble visibleScreenRectInViewCoordinates() const =0
virtual OdGeMatrix3d getWorldToEyeTransform() const =0
virtual double screenWidth() const =0
virtual bool IsPaperSpaceOverall() const =0
virtual int PointToView(const OdGePoint2d &pointSCS, OdGePoint2d &viewPt) const =0
virtual bool IsDragging() const =0
virtual OdInt16 GetCadWindowId() const =0
virtual void screenRect(OdGsDCPoint &lowerLeft, OdGsDCPoint &upperRight) const =0
virtual size_t numDrawables() const =0
virtual double visibleWidth() const =0
virtual void SetElevation(double dElev)=0
virtual void SetFieldAspectMaintained(bool)=0
virtual OdGeExtents3d GetRealExtents(volatile bool *abortFlag=0) const =0
virtual void EndTransaction()=0
virtual int PointToWCS(const OdGsDCPoint &pointSCS, const OdGePlane &plane, OdGePoint3d &pointWCS) const =0
virtual const CFxViewportSnapShot * GetPreviousViewSettings() const =0
virtual bool SetPreviousData()=0
virtual bool IsRectangular() const =0
virtual double screenHeight() const =0
virtual int PointToWCSOnUCS(const OdGsDCPoint &pointSCS, OdGePoint3d &pointWCS) const =0
virtual OdGeMatrix3d GetCorrectionScreenMatrix() const =0
virtual OdGeMatrix3d getEyeToScreenMatrix() const =0
virtual OdGeMatrix3d getEyeToWorldTransform() const =0
virtual const CFxVectorizeDevice * GetFxVectorizeDevice() const =0
virtual int PointToWCS(const CFxPointF &pointSCS, const OdGePlane &plane, OdGePoint3d &pointWCS) const =0
virtual bool IsZoomMode() const =0
virtual double visibleHeight() const =0
virtual void PointToSCS(const OdGePoint3d &pointWCS, CFxPoint &pointSCS) const =0
virtual double Elevation() const =0
virtual int PointToView(const OdGsDCPoint &pointSCS, OdGePoint2d &viewPt) const =0
virtual void SetPanMode(bool bVal)=0
virtual bool IsPanMode() const =0
virtual void EnterDragMode()=0
virtual double focalLength() const =0
virtual const QPainterPath & GetViewportInternalRegion() const =0
virtual void PointToSCS(const OdGePoint3d &pointWCS, CFxPointF &pointSCS) const =0
virtual void screenRect(OdGePoint2d &lowerLeft, OdGePoint2d &upperRight) const =0
virtual OdGeMatrix3d EyeToPaperSpace() const =0
virtual int PointToWCSOnUCS(const OdGePoint3d &pointSCS, OdGePoint3d &pointWCS) const =0
virtual bool IsPreviousVectorizationAborted() const =0
virtual bool ZoomExtentsWCS(const OdGeBoundBlock3d *pExtents)=0
virtual void AddViewReactor(CFxViewReactor *pReactor)=0
virtual void StartTransaction()=0
virtual const OdGePoint3dArray & GetViewportExternalRegionWCS() const =0
virtual void SetOrbitMode(bool bVal)=0
virtual CFxVectorizeDevice * GetFxVectorizeDevice()=0
virtual double GetDeviation(const OdGiDeviationType deviationType, const OdGePoint3d &pointOnCurve) const =0
virtual ViewportKey GetVpNum() const =0
virtual void SetZoomMode(bool bVal)=0
virtual void LeaveDragMode()=0
virtual void PointToSCS(const OdGePoint3d &pointWCS, OdGsDCPoint &pointSCS) const =0
virtual bool IsActive() const =0
virtual bool IsOrbitMode() const =0
virtual OdGeVector3d viewDir() const =0
virtual OdGeMatrix3d PaperSpaceToEye() const =0
static OdGeMatrix3d PaperSpaceToEye(OdDbObjectId idViewport)
virtual bool IsOverall() const =0
static OdGeMatrix3d WorldToView(OdDbObjectId id)
virtual int PointToWCSOnUCS(const OdGePoint2d &pointSCS, OdGePoint3d &pointWCS) const =0
virtual void RemoveViewReactor(CFxViewReactor *pReactor)=0
virtual OdGiDrawablePtr drawableAt(size_t iIndex) const =0
~CFxView() override
virtual bool InsideTransaction() const =0
virtual OdGsDCRectDouble visibleScreenRect() const =0
static OdGeMatrix3d EyeToPaperSpace(OdDbObjectId idViewport)
virtual OdDbStub * viewportObjectId() const =0
virtual const QPainterPath & GetViewportExternalRegion() const =0
virtual const OdGePoint3dArray & GetViewportInternalRegionWCS() const =0
virtual bool IsFieldAspectMaintained() const =0
ODRX_DECLARE_MEMBERS(CFxView)
virtual bool GetGeomExtents(OdGeBoundBlock3d &bounds, volatile bool *abortFlag=0) const =0
virtual bool ViewExtentsWCS(OdGeBoundBlock3d &extents) const =0
const OdGePoint3d & GetPosition() const
Definition: FxView.h:91
static bool IsViewSettingsValid(const OdDbViewport *pViewport)
const OdGePoint3d & GetTarget() const
Definition: FxView.h:102
double GetPixelHeight() const
Definition: FxView.h:168
const OdGeVector3d & GetEyeVector() const
Definition: FxView.h:113
bool InitializeFromViewInfo(const CFxViewDrawInfo *pViewInfo)
double GetFieldWidth() const
Definition: FxView.h:135
const OdGsDCRectDouble & GetVisibleRect() const
Definition: FxView.h:195
double GetFieldHeight() const
Definition: FxView.h:146
const OdGeVector3d & GetUpVector() const
Definition: FxView.h:124
static bool IsViewExtentsValid(const OdGeExtents3d &extents)
double GetFocalLength() const
Definition: FxView.h:179
static bool IsViewSettingsValid(const OdGsView *pView)
OdGePoint2d GetNumPixelsInUnitSquare(double iWidthInPixels, double iHeighInPixels, const OdGePoint3d &point, bool bUsePerspective) const
double GetPixelWidth() const
Definition: FxView.h:157
void ApplyToView(CFxView *pView)
const OdGeMatrix3d & GetWorldToEyeMatrix() const
Definition: FxView.h:190
bool InitializeFromView(const CFxView *pView)
Definition: Gs.h:140