CFx SDK Documentation 2024 SP0
Loading...
Searching...
No Matches
TrRndLocalViewer.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// GLES2 device local viewer interface
24
25#ifndef ODTRRNDLOCALVIEWER
26#define ODTRRNDLOCALVIEWER
27
28#include "OdVector.h"
29#include "TrRndLocalRenderer.h"
30
31#include "TD_PackPush.h"
32
37{
38 public:
40 virtual const OdTrRndLocalRenderer *renderer() const = 0;
41
42 virtual ODCOLORREF backgroundColor() const = 0;
43 virtual void setBackgroundColor(ODCOLORREF rgba) = 0;
44
45 // Viewer capabilities
46
47 // Resize client area
48 virtual void resize(const OdGsDCRect &dcRect) = 0;
49 // Redraw graphics
50 virtual void update(OdTrVisRenderClient *pDevice) = 0;
51
52 // Returns active viewport index
53 virtual OdUInt32 activeViewportIndex() const = 0;
54 // Returns active viewport Id
56 // Compare viewport Id with active viewport Id
57 virtual bool isActiveViewport(OdTrVisViewportId vpId) const = 0;
58 // Set active viewport
59 virtual void setActiveViewport(OdTrVisViewportId vpId) = 0;
60 // Set active viewport index
61 virtual void setActiveViewportIndex(int nViewport) = 0;
62
63 // Returns active viewport intended for selection
65
66 // Produce panning operation
67 virtual void pan(int nX, int nY) = 0;
68 // Produce simple zooming operation
69 virtual void zoom(float fDelta) = 0;
70 // Zooming around point
71 virtual void zoom(int nX, int nY, float fDelta) = 0;
72 // Orbit
74 {
79 };
80 virtual void orbit(int nX, int nY, OrbitType type = kOrbitPerp, float angle = 0.0f) = 0;
81 // Zoom extents
82 virtual void zoomExtents(float coef = 1.03f) = 0;
83
84 // Low-level transformation routines
85 virtual void translate(const OdGeVector3d &offset) = 0;
86 virtual void rotate(double xAngle, double yAngle, double zAngle, bool bLocalCS = true) = 0;
87
88 // Returns layers list
90 virtual void getLayersList(LayersList &layers) const = 0;
91 // Returns layer data
92 virtual const OdTrVisLayerDef *getLayerDef(OdTrVisLayerId layerId) const = 0;
93 // Returns layer name
94 virtual const OdString &getLayerName(OdTrVisLayerId layerId) const = 0;
95
96 // Enable layer
97 virtual void enableLayer(OdTrVisLayerId layerId, bool bByViewport = false) = 0;
98 // Disable layer
99 virtual void disableLayer(OdTrVisLayerId layerId, bool bByViewport = false) = 0;
100 // Toggle (invert) layer state
101 virtual void toggleLayer(OdTrVisLayerId layerId, bool bByViewport = false) = 0;
102
103 // Highlighting
104 virtual void highlightAll(bool bHighlight, bool bByViewport = true) = 0;
105 virtual void highlightByOwnerId(OdTrVisOwning ownerId, bool bHighlight, bool bByViewport = true) = 0;
106
107 // Select viewport
108 virtual OdTrVisViewportId pickViewport(int nX, int nY) = 0;
109
110 // Render mode support (will be deprecated after VisualStyles implementation)
113
114 // Section planes
115 virtual void addSectionPlane(OdTrVisViewportId vpId, const OdTrVisSectionPlane &plane) = 0;
116 virtual void removeSectionPlane(OdTrVisViewportId vpId) = 0;
118 virtual const OdTrVisSectionPlane *getSectionPlane(OdTrVisViewportId vpId, OdUInt32 nPlane = 0) const = 0;
119 virtual void transformSectionPlanes(OdTrVisViewportId vpId, const OdGeMatrix3d &xForm) = 0;
120
121 // Mark viewport modified
122 virtual void markViewportModified(OdTrVisViewportId id, bool bViewProps = true, bool bRenderMode = false) = 0;
123 //virtual OdUInt32 viewportIndex(OdTrVisViewportId id) const = 0;
124
125 // Recompute scene depth
127};
128
133{
134 public:
137};
138
142class OdTrRndLocalViewerPtr : public TPtr<OdTrRndLocalViewer, OdTrRndLocalViewerTPtrAdaptor>
143{
144 public:
149 OdTrRndLocalViewerPtr(const OdTrRndLocalViewer* pObj, bool bAttach = false)
152 : TPtr<OdTrRndLocalViewer, OdTrRndLocalViewerTPtrAdaptor>(pRenderer->viewer()) {}
160};
161
162#include "TD_PackPop.h"
163
164#endif // ODTRRNDLOCALVIEWER
#define ODCOLORREF
Definition: OdPlatform.h:933
unsigned int OdUInt32
RenderMode
Definition: Gs.h:148
virtual OdTrRndLocalViewer * viewer()=0
static void release(OdTrRndLocalRenderer *pObj)
static void addRef(OdTrRndLocalRenderer *pObj)
virtual const OdTrVisSectionPlane * getSectionPlane(OdTrVisViewportId vpId, OdUInt32 nPlane=0) const =0
virtual void resize(const OdGsDCRect &dcRect)=0
virtual const OdString & getLayerName(OdTrVisLayerId layerId) const =0
virtual void setRenderMode(OdTrVisViewportId vpId, OdGsView::RenderMode rm)=0
virtual void zoomExtents(float coef=1.03f)=0
virtual OdUInt32 sectionPlanesNumber(OdTrVisViewportId vpId) const =0
virtual void orbit(int nX, int nY, OrbitType type=kOrbitPerp, float angle=0.0f)=0
virtual void markViewportModified(OdTrVisViewportId id, bool bViewProps=true, bool bRenderMode=false)=0
virtual void translate(const OdGeVector3d &offset)=0
virtual OdGsView::RenderMode renderMode(OdTrVisViewportId vpId) const =0
virtual ODCOLORREF backgroundColor() const =0
virtual void setBackgroundColor(ODCOLORREF rgba)=0
virtual bool isActiveViewport(OdTrVisViewportId vpId) const =0
virtual void toggleLayer(OdTrVisLayerId layerId, bool bByViewport=false)=0
virtual void disableLayer(OdTrVisLayerId layerId, bool bByViewport=false)=0
virtual OdTrRndLocalRenderer * renderer()=0
virtual void zoom(int nX, int nY, float fDelta)=0
virtual void zoom(float fDelta)=0
OdVector< OdTrVisLayerId, OdMemoryAllocator< OdTrVisLayerId > > LayersList
virtual void setActiveViewportIndex(int nViewport)=0
virtual void removeSectionPlane(OdTrVisViewportId vpId)=0
virtual void addSectionPlane(OdTrVisViewportId vpId, const OdTrVisSectionPlane &plane)=0
virtual bool recomputeSceneDepth(OdTrVisViewportId vpId)=0
virtual void rotate(double xAngle, double yAngle, double zAngle, bool bLocalCS=true)=0
virtual const OdTrVisLayerDef * getLayerDef(OdTrVisLayerId layerId) const =0
virtual OdTrVisViewportId activeViewportId() const =0
virtual OdTrVisViewportId pickViewport(int nX, int nY)=0
virtual void pan(int nX, int nY)=0
virtual void enableLayer(OdTrVisLayerId layerId, bool bByViewport=false)=0
virtual OdTrVisViewportId activeSelectionViewportId() const =0
virtual void highlightAll(bool bHighlight, bool bByViewport=true)=0
virtual void update(OdTrVisRenderClient *pDevice)=0
virtual const OdTrRndLocalRenderer * renderer() const =0
virtual OdUInt32 activeViewportIndex() const =0
virtual void setActiveViewport(OdTrVisViewportId vpId)=0
virtual void getLayersList(LayersList &layers) const =0
virtual void transformSectionPlanes(OdTrVisViewportId vpId, const OdGeMatrix3d &xForm)=0
virtual void highlightByOwnerId(OdTrVisOwning ownerId, bool bHighlight, bool bByViewport=true)=0
OdTrRndLocalViewerPtr(const OdTrRndLocalViewerPtr &ref)
OdTrRndLocalViewerPtr & operator=(OdTrRndLocalViewer *pObj)
OdTrRndLocalViewerPtr(const OdTrRndLocalViewer *pObj, bool bAttach=false)
OdTrRndLocalViewerPtr(const OdTrRndLocalRenderer *pRenderer)
static void release(OdTrRndLocalViewer *pObj)
static void addRef(OdTrRndLocalViewer *pObj)
Definition: TPtr.h:76
TPtr & operator=(TObj *pObj)
Definition: TPtr.h:103
GLenum GLint ref
Definition: gles2_ext.h:262
GLuint GLsizei GLsizei GLint GLenum * type
Definition: gles2_ext.h:274
GLintptr offset
Definition: gles2_ext.h:183