CFx SDK Documentation  2020SP3
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
OdGeVector3d
Definition: GeVector3d.h:54
NULL
#define NULL
Definition: GsProperties.h:177
OdTrGL2LocalViewerPtr::release
void release()
Definition: TrRndLocalViewer.h:154
OdGsView::RenderMode
RenderMode
Definition: Gs.h:138
OdTrGL2LocalRenditionClient
Definition: TrGL2LocalRenditionHost.h:81
OdTrGL2LocalViewer::setActiveViewportIndex
virtual void setActiveViewportIndex(int nViewport)=0
TPtr::operator=
TPtr & operator=(TObj *pObj)
Definition: TPtr.h:103
OdTrVisLayerDef
Definition: TrVisLayerDef.h:84
OdTrGL2LocalViewer::renderMode
virtual OdGsView::RenderMode renderMode(OdTrVisViewportId vpId) const =0
OdVector.h
OdTrGL2LocalViewer::kOrbitVertical
@ kOrbitVertical
Definition: TrRndLocalViewer.h:74
OdTrGL2LocalViewerPtr::OdTrGL2LocalViewerPtr
OdTrGL2LocalViewerPtr(const OdTrVisRendition *pRendition)
type
GLuint GLsizei GLsizei GLint GLenum * type
Definition: gles2_ext.h:274
OdTrGL2LocalRenderer
Definition: TrRndLocalRenderer.h:39
OdTrGL2LocalViewerPtr::OdTrGL2LocalViewerPtr
OdTrGL2LocalViewerPtr(const OdTrGL2LocalViewer *pObj, bool bAttach=false)
Definition: TrRndLocalViewer.h:144
OdTrGL2LocalViewer::getLayersList
virtual void getLayersList(LayersList &layers) const =0
OdTrGL2LocalViewer::activeViewportIndex
virtual OdUInt32 activeViewportIndex() const =0
OdGsDCRect
Definition: GsDefs.h:111
OdTrGL2LocalViewer::zoom
virtual void zoom(int nX, int nY, float fDelta)=0
OdTrGL2LocalViewer::removeSectionPlane
virtual void removeSectionPlane(OdTrVisViewportId vpId)=0
TD_PackPop.h
OdTrGL2LocalViewer::setBackgroundColor
virtual void setBackgroundColor(ODCOLORREF rgba)=0
OdTrGL2LocalViewer::OrbitType
OrbitType
Definition: TrRndLocalViewer.h:71
OdUInt32
unsigned int OdUInt32
Definition: OdPlatformSettings.h:783
OdGeMatrix3d
Definition: GeMatrix3d.h:73
OdTrGL2LocalViewer::getSectionPlane
virtual OdTrVisSectionPlane * getSectionPlane(OdTrVisViewportId vpId, OdUInt32 nPlane=0) const =0
OdTrGL2LocalRendererTPtrAdaptor::addRef
static void addRef(OdTrGL2LocalRenderer *pObj)
Definition: TrRndLocalRenderer.h:186
OdTrGL2LocalViewer::enableLayer
virtual void enableLayer(OdTrVisLayerId layerId, bool bByViewport=false)=0
ref
GLenum GLint ref
Definition: gles2_ext.h:262
OdTrGL2LocalViewer::kOrbitPerp
@ kOrbitPerp
Definition: TrRndLocalViewer.h:72
OdTrGL2LocalViewer::recomputeSceneDepth
virtual bool recomputeSceneDepth(OdTrVisViewportId vpId)=0
OdTrGL2LocalViewer::update
virtual void update(OdTrVisRenderClient *pDevice)=0
OdTrGL2LocalViewer::getLayerDef
virtual const OdTrVisLayerDef * getLayerDef(OdTrVisLayerId layerId) const =0
OdTrGL2LocalViewer::rotate
virtual void rotate(double xAngle, double yAngle, double zAngle, bool bLocalCS=true)=0
OdTrGL2LocalViewer
Definition: TrRndLocalViewer.h:37
OdTrGL2LocalViewer::activeViewportId
virtual OdTrVisViewportId activeViewportId() const =0
OdTrGL2LocalViewer::resize
virtual void resize(const OdGsDCRect &dcRect)=0
OdTrGL2LocalViewerTPtrAdaptor::addRef
static void addRef(OdTrGL2LocalViewer *pObj)
Definition: TrRndLocalViewer.h:130
OdTrGL2LocalViewer::highlightByOwnerId
virtual void highlightByOwnerId(const OdDbStub *pOwner, bool bHighlight, bool bByViewport=true)=0
OdTrGL2LocalViewer::LayersList
OdVector< OdTrVisLayerId, OdMemoryAllocator< OdTrVisLayerId > > LayersList
Definition: TrRndLocalViewer.h:86
offset
GLintptr offset
Definition: gles2_ext.h:183
OdTrGL2LocalViewer::addSectionPlane
virtual void addSectionPlane(OdTrVisViewportId vpId, const OdTrVisSectionPlane &plane)=0
OdTrGL2LocalViewer::markViewportModified
virtual void markViewportModified(OdTrVisViewportId id, OdUInt32 kindOfMod)=0
OdTrGL2LocalViewerPtr
Definition: TrRndLocalViewer.h:138
TrRndLocalRenderer.h
OdTrGL2LocalViewerPtr::OdTrGL2LocalViewerPtr
OdTrGL2LocalViewerPtr(const OdTrGL2LocalViewerPtr &ref)
Definition: TrRndLocalViewer.h:142
OdTrGL2LocalRendererTPtrAdaptor::release
static void release(OdTrGL2LocalRenderer *pObj)
Definition: TrRndLocalRenderer.h:187
OdTrGL2LocalViewer::kOrbitEye
@ kOrbitEye
Definition: TrRndLocalViewer.h:75
OdVector
Definition: OdVector.h:54
OdTrGL2LocalViewer::pan
virtual void pan(int nX, int nY)=0
OdTrGL2LocalViewer::renderer
virtual OdTrGL2LocalRenderer * renderer()=0
OdTrGL2LocalViewer::isActiveViewport
virtual bool isActiveViewport(OdTrVisViewportId vpId) const =0
TD_PackPush.h
OdTrGL2LocalViewer::toggleLayer
virtual void toggleLayer(OdTrVisLayerId layerId, bool bByViewport=false)=0
OdTrGL2LocalViewerPtr::OdTrGL2LocalViewerPtr
OdTrGL2LocalViewerPtr(const OdTrGL2LocalRenderer *pRenderer)
OdTrGL2LocalViewerPtr::OdTrGL2LocalViewerPtr
OdTrGL2LocalViewerPtr()
Definition: TrRndLocalViewer.h:140
OdTrGL2LocalViewer::setActiveViewport
virtual void setActiveViewport(OdTrVisViewportId vpId)=0
OdTrGL2LocalViewer::backgroundColor
virtual ODCOLORREF backgroundColor() const =0
OdTrGL2LocalViewer::kOrbitHorizontal
@ kOrbitHorizontal
Definition: TrRndLocalViewer.h:73
OdTrGL2LocalViewer::zoomExtents
virtual void zoomExtents(float coef=1.03f)=0
OdTrVisRenderClient
Definition: TrVisRenderClient.h:40
OdTrGL2LocalViewerPtr::operator=
OdTrGL2LocalViewerPtr & operator=(OdTrGL2LocalViewer *pObj)
Definition: TrRndLocalViewer.h:148
OdTrGL2LocalViewer::transformSectionPlanes
virtual void transformSectionPlanes(OdTrVisViewportId vpId, const OdGeMatrix3d &xForm)=0
TPtr
Definition: TPtr.h:76
OdTrGL2LocalViewer::orbit
virtual void orbit(int nX, int nY, OrbitType type=kOrbitPerp, float angle=0.0f)=0
OdTrGL2LocalViewer::zoom
virtual void zoom(float fDelta)=0
OdTrVisRendition
Definition: TrVisRendition.h:61
f
GLfloat f
Definition: gles2_ext.h:564
OdTrGL2LocalViewer::translate
virtual void translate(const OdGeVector3d &offset)=0
OdTrGL2LocalRendererTPtrAdaptor
Definition: TrRndLocalRenderer.h:184
OdTrGL2LocalViewerTPtrAdaptor::release
static void release(OdTrGL2LocalViewer *pObj)
Definition: TrRndLocalViewer.h:131
ODCOLORREF
#define ODCOLORREF
Definition: OdPlatform.h:883
OdTrGL2LocalViewer::disableLayer
virtual void disableLayer(OdTrVisLayerId layerId, bool bByViewport=false)=0
OdTrGL2LocalViewer::pickViewport
virtual OdTrVisViewportId pickViewport(int nX, int nY)=0
OdTrGL2LocalViewerTPtrAdaptor
Definition: TrRndLocalViewer.h:128
OdTrGL2LocalViewer::sectionPlanesNumber
virtual OdUInt32 sectionPlanesNumber(OdTrVisViewportId vpId) const =0
OdTrGL2LocalViewer::setRenderMode
virtual void setRenderMode(OdTrVisViewportId vpId, OdGsView::RenderMode rm)=0
OdTrGL2LocalViewerPtr::create
OdTrGL2LocalViewerPtr & create(OdTrGL2LocalRenditionClient *pClient)
OdTrGL2LocalViewer::highlightAll
virtual void highlightAll(bool bHighlight, bool bByViewport=true)=0
OdTrGL2LocalViewer::renderer
virtual const OdTrGL2LocalRenderer * renderer() const =0
OdTrVisSectionPlane
Definition: TrVisDefs.h:195
OdUInt64
Definition: Int64.h:137