CFx SDK Documentation  2022 SP0
TrRndLocalViewer.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 // 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 OdTrGL2LocalRenderer *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
55  virtual OdTrVisViewportId activeViewportId() const = 0;
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  // Produce panning operation
64  virtual void pan(int nX, int nY) = 0;
65  // Produce simple zooming operation
66  virtual void zoom(float fDelta) = 0;
67  // Zooming around point
68  virtual void zoom(int nX, int nY, float fDelta) = 0;
69  // Orbit
70  enum OrbitType
71  {
75  kOrbitEye
76  };
77  virtual void orbit(int nX, int nY, OrbitType type = kOrbitPerp, float angle = 0.0f) = 0;
78  // Zoom extents
79  virtual void zoomExtents(float coef = 1.03f) = 0;
80 
81  // Low-level transformation routines
82  virtual void translate(const OdGeVector3d &offset) = 0;
83  virtual void rotate(double xAngle, double yAngle, double zAngle, bool bLocalCS = true) = 0;
84 
85  // Returns layers list
87  virtual void getLayersList(LayersList &layers) const = 0;
88  // Returns layer data
89  virtual const OdTrVisLayerDef *getLayerDef(OdTrVisLayerId layerId) const = 0;
90 
91  // Enable layer
92  virtual void enableLayer(OdTrVisLayerId layerId, bool bByViewport = false) = 0;
93  // Disable layer
94  virtual void disableLayer(OdTrVisLayerId layerId, bool bByViewport = false) = 0;
95  // Toggle (invert) layer state
96  virtual void toggleLayer(OdTrVisLayerId layerId, bool bByViewport = false) = 0;
97 
98  // Highlighting
99  virtual void highlightAll(bool bHighlight, bool bByViewport = true) = 0;
100  virtual void highlightByOwnerId(const OdDbStub *pOwner, bool bHighlight, bool bByViewport = true) = 0;
101 
102  // Select viewport
103  virtual OdTrVisViewportId pickViewport(int nX, int nY) = 0;
104 
105  // Render mode support (will be deprecated after VisualStyles implementation)
108 
109  // Section planes
110  virtual void addSectionPlane(OdTrVisViewportId vpId, const OdTrVisSectionPlane &plane) = 0;
111  virtual void removeSectionPlane(OdTrVisViewportId vpId) = 0;
113  virtual OdTrVisSectionPlane *getSectionPlane(OdTrVisViewportId vpId, OdUInt32 nPlane = 0) const = 0;
114  virtual void transformSectionPlanes(OdTrVisViewportId vpId, const OdGeMatrix3d &xForm) = 0;
115 
116  // Mark viewport modified
117  virtual void markViewportModified(OdTrVisViewportId id, OdUInt32 kindOfMod) = 0;
118  //virtual OdUInt32 viewportIndex(OdTrVisViewportId id) const = 0;
119 
120  // Recompute scene depth
121  virtual bool recomputeSceneDepth(OdTrVisViewportId vpId) = 0;
122 };
123 
128 {
129  public:
130  static void addRef(OdTrGL2LocalViewer* pObj) { if (pObj) OdTrGL2LocalRendererTPtrAdaptor::addRef (pObj->renderer()); }
132 };
133 
137 class OdTrGL2LocalViewerPtr : public TPtr<OdTrGL2LocalViewer, OdTrGL2LocalViewerTPtrAdaptor>
138 {
139  public:
144  OdTrGL2LocalViewerPtr(const OdTrGL2LocalViewer* pObj, bool bAttach = false)
156 };
157 
158 #include "TD_PackPop.h"
159 
160 #endif // ODTRRNDLOCALVIEWER
#define NULL
Definition: GsProperties.h:177
#define ODCOLORREF
Definition: OdPlatform.h:883
unsigned int OdUInt32
RenderMode
Definition: Gs.h:138
static void addRef(OdTrGL2LocalRenderer *pObj)
static void release(OdTrGL2LocalRenderer *pObj)
virtual OdTrVisViewportId activeViewportId() const =0
virtual void markViewportModified(OdTrVisViewportId id, OdUInt32 kindOfMod)=0
virtual void transformSectionPlanes(OdTrVisViewportId vpId, const OdGeMatrix3d &xForm)=0
virtual void zoom(float fDelta)=0
virtual OdTrGL2LocalRenderer * renderer()=0
virtual void zoomExtents(float coef=1.03f)=0
virtual void pan(int nX, int nY)=0
OdVector< OdTrVisLayerId, OdMemoryAllocator< OdTrVisLayerId > > LayersList
virtual ODCOLORREF backgroundColor() const =0
virtual void highlightAll(bool bHighlight, bool bByViewport=true)=0
virtual void update(OdTrVisRenderClient *pDevice)=0
virtual void rotate(double xAngle, double yAngle, double zAngle, bool bLocalCS=true)=0
virtual OdUInt32 sectionPlanesNumber(OdTrVisViewportId vpId) const =0
virtual bool isActiveViewport(OdTrVisViewportId vpId) const =0
virtual void getLayersList(LayersList &layers) const =0
virtual void setActiveViewport(OdTrVisViewportId vpId)=0
virtual OdTrVisSectionPlane * getSectionPlane(OdTrVisViewportId vpId, OdUInt32 nPlane=0) const =0
virtual void removeSectionPlane(OdTrVisViewportId vpId)=0
virtual void addSectionPlane(OdTrVisViewportId vpId, const OdTrVisSectionPlane &plane)=0
virtual bool recomputeSceneDepth(OdTrVisViewportId vpId)=0
virtual void disableLayer(OdTrVisLayerId layerId, bool bByViewport=false)=0
virtual void setActiveViewportIndex(int nViewport)=0
virtual void toggleLayer(OdTrVisLayerId layerId, bool bByViewport=false)=0
virtual void enableLayer(OdTrVisLayerId layerId, bool bByViewport=false)=0
virtual void setRenderMode(OdTrVisViewportId vpId, OdGsView::RenderMode rm)=0
virtual void zoom(int nX, int nY, float fDelta)=0
virtual const OdTrVisLayerDef * getLayerDef(OdTrVisLayerId layerId) const =0
virtual OdTrVisViewportId pickViewport(int nX, int nY)=0
virtual OdUInt32 activeViewportIndex() const =0
virtual void translate(const OdGeVector3d &offset)=0
virtual void resize(const OdGsDCRect &dcRect)=0
virtual const OdTrGL2LocalRenderer * renderer() const =0
virtual void setBackgroundColor(ODCOLORREF rgba)=0
virtual void orbit(int nX, int nY, OrbitType type=kOrbitPerp, float angle=0.0f)=0
virtual OdGsView::RenderMode renderMode(OdTrVisViewportId vpId) const =0
virtual void highlightByOwnerId(const OdDbStub *pOwner, bool bHighlight, bool bByViewport=true)=0
OdTrGL2LocalViewerPtr(const OdTrVisRendition *pRendition)
OdTrGL2LocalViewerPtr(const OdTrGL2LocalViewer *pObj, bool bAttach=false)
OdTrGL2LocalViewerPtr & operator=(OdTrGL2LocalViewer *pObj)
OdTrGL2LocalViewerPtr(const OdTrGL2LocalRenderer *pRenderer)
OdTrGL2LocalViewerPtr(const OdTrGL2LocalViewerPtr &ref)
OdTrGL2LocalViewerPtr & create(OdTrGL2LocalRenditionClient *pClient)
static void release(OdTrGL2LocalViewer *pObj)
static void addRef(OdTrGL2LocalViewer *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