/usr/include/oce/OpenGl_View.hxx is in liboce-visualization-dev 0.15-4.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 | // Created on: 2011-09-20
// Created by: Sergey ZERCHANINOV
// Copyright (c) 2011-2014 OPEN CASCADE SAS
//
// This file is part of Open CASCADE Technology software library.
//
// This library is free software; you can redistribute it and / or modify it
// under the terms of the GNU Lesser General Public version 2.1 as published
// by the Free Software Foundation, with special exception defined in the file
// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
// distribution for complete text of the license and disclaimer of any warranty.
//
// Alternatively, this file may be used under the terms of Open CASCADE
// commercial license or contractual agreement.
#ifndef _OpenGl_View_Header
#define _OpenGl_View_Header
#include <MMgt_TShared.hxx>
#include <Standard_DefineHandle.hxx>
#include <TColStd_Array2OfReal.hxx>
#include <NCollection_List.hxx>
#include <Quantity_NameOfColor.hxx>
#include <Aspect_FillMethod.hxx>
#include <Aspect_GradientFillMethod.hxx>
#include <Aspect_TypeOfTriedronPosition.hxx>
#include <Aspect_CLayer2d.hxx>
#include <InterfaceGraphic_Graphic3d.hxx>
#include <InterfaceGraphic_Visual3d.hxx>
#include <Graphic3d_CView.hxx>
#include <Graphic3d_CGraduatedTrihedron.hxx>
#include <Graphic3d_SequenceOfHClipPlane.hxx>
#include <Visual3d_TypeOfSurfaceDetail.hxx>
#include <OpenGl_telem_view.hxx>
#include <OpenGl_LayerList.hxx>
#include <OpenGl_Light.hxx>
#include <Handle_OpenGl_Context.hxx>
#include <Handle_OpenGl_GraphicDriver.hxx>
#include <Handle_OpenGl_Display.hxx>
#include <Handle_OpenGl_Workspace.hxx>
#include <Handle_OpenGl_View.hxx>
#include <Handle_OpenGl_Texture.hxx>
struct OPENGL_BG_TEXTURE
{
Tuint TexId;
Tint Width;
Tint Height;
Aspect_FillMethod Style;
};
struct OPENGL_BG_GRADIENT
{
TEL_COLOUR color1;
TEL_COLOUR color2;
Aspect_GradientFillMethod type;
};
struct OPENGL_EXTRA_REP
{
Tfloat vrp[3];
Tfloat vpn[3];
Tfloat vup[3];
TEL_VIEW_MAPPING map;
Tfloat scaleFactors[3];
};
struct OPENGL_ZCLIP
{
struct {
Standard_Boolean IsOn;
Standard_ShortReal Limit; /* in the range [0., 1.] */
} Back;
struct {
Standard_Boolean IsOn;
Standard_ShortReal Limit; /* in the range [0., 1.] */
} Front;
};
struct OPENGL_FOG
{
Standard_Boolean IsOn;
Standard_ShortReal Front; /* in the range [0., 1.] */
Standard_ShortReal Back; /* in the range [0., 1.] */
TEL_COLOUR Color;
};
class OpenGl_GraduatedTrihedron;
class OpenGl_Structure;
class OpenGl_Trihedron;
class Handle(OpenGl_PrinterContext);
class OpenGl_StateCounter;
class OpenGl_View : public MMgt_TShared
{
public:
OpenGl_View (const CALL_DEF_VIEWCONTEXT &AContext, OpenGl_StateCounter* theCounter);
virtual ~OpenGl_View ();
void ReleaseGlResources (const Handle(OpenGl_Context)& theCtx);
void SetTextureEnv (const Handle(OpenGl_Context)& theCtx,
const Handle(Graphic3d_TextureEnv)& theTexture);
void SetSurfaceDetail (const Visual3d_TypeOfSurfaceDetail AMode);
void SetBackfacing (const Standard_Integer AMode);
void SetLights (const CALL_DEF_VIEWCONTEXT &AContext);
void SetAntiAliasing (const Standard_Boolean AMode) { myAntiAliasing = AMode; }
void SetClipPlanes (const Graphic3d_SequenceOfHClipPlane &thePlanes) { myClipPlanes = thePlanes; }
void SetVisualisation (const CALL_DEF_VIEWCONTEXT &AContext);
void SetClipLimit (const Graphic3d_CView& theCView);
void SetMapping (const Handle(OpenGl_Display)& theGlDisplay, const Graphic3d_CView& theCView);
void SetOrientation (const Graphic3d_CView& theCView);
void SetFog (const Graphic3d_CView& theCView, const Standard_Boolean theFlag);
void TriedronDisplay (const Handle(OpenGl_Context)& theCtx,
const Aspect_TypeOfTriedronPosition thePosition,
const Quantity_NameOfColor theColor,
const Standard_Real theScale,
const Standard_Boolean theAsWireframe);
void TriedronErase (const Handle(OpenGl_Context)& theCtx);
void GraduatedTrihedronDisplay (const Handle(OpenGl_Context)& theCtx,
const Graphic3d_CGraduatedTrihedron& theCubic);
void GraduatedTrihedronErase (const Handle(OpenGl_Context)& theCtx);
Standard_Boolean ProjectObjectToRaster (const Standard_Integer w, const Standard_Integer h,
const Standard_ShortReal x, const Standard_ShortReal y, const Standard_ShortReal z,
Standard_ShortReal &xr, Standard_ShortReal &yr);
Standard_Boolean ProjectRasterToObject (const Standard_Integer w, const Standard_Integer h,
const Standard_Integer xr, const Standard_Integer yr,
Standard_ShortReal &x, Standard_ShortReal &y, Standard_ShortReal &z);
Standard_Boolean ProjectRasterToObjectWithRay (const Standard_Integer w, const Standard_Integer h,
const Standard_Integer xr, const Standard_Integer yr,
Standard_ShortReal &x, Standard_ShortReal &y, Standard_ShortReal &z,
Standard_ShortReal &dx, Standard_ShortReal &dy, Standard_ShortReal &dz);
void GetMatrices (TColStd_Array2OfReal& theMatOrient,
TColStd_Array2OfReal& theMatMapping,
const Standard_Boolean theIsCustom) const;
Standard_Real Height () const { return (myExtra.map.window.xmax - myExtra.map.window.xmin); }
Standard_Real Width () const { return (myExtra.map.window.ymax - myExtra.map.window.ymin); }
Standard_Integer Backfacing () const { return myBackfacing; }
const TEL_TRANSFORM_PERSISTENCE * BeginTransformPersistence (const Handle(OpenGl_Context)& theCtx,
const TEL_TRANSFORM_PERSISTENCE *theTransPers);
void EndTransformPersistence (const Handle(OpenGl_Context)& theCtx);
//! Add structure to display list with specified priority.
//! The structure will be added to associated with it z layer.
//! If the z layer is not presented in the view, the structure will
//! be displayed in default bottom-level z layer.
void DisplayStructure (const OpenGl_Structure *theStructure,
const Standard_Integer thePriority);
//! Erase structure from display list.
void EraseStructure (const OpenGl_Structure *theStructure);
//! Insert a new top-level z layer with ID <theLayerId>
void AddZLayer (const Standard_Integer theLayerId);
//! Remove a z layer with ID <theLayerId>
void RemoveZLayer (const Standard_Integer theLayerId);
//! Display structure in z layer with ID <theNewLayerId>
//! If the layer with ID <theNewLayerId> is not presented in the view,
//! the structure will be displayed in default bottom-level layer.
void ChangeZLayer (const OpenGl_Structure *theStructure,
const Standard_Integer theNewLayerId);
void CreateBackgroundTexture (const Standard_CString AFileName, const Aspect_FillMethod AFillStyle);
void SetBackgroundTextureStyle (const Aspect_FillMethod FillStyle);
void SetBackgroundGradient (const Quantity_Color& AColor1, const Quantity_Color& AColor2, const Aspect_GradientFillMethod AType);
void SetBackgroundGradientType (const Aspect_GradientFillMethod AType);
void Render (const Handle(OpenGl_PrinterContext)& thePrintContext,
const Handle(OpenGl_Workspace)& theWorkspace,
const Graphic3d_CView& theCView,
const Aspect_CLayer2d& theCUnderLayer,
const Aspect_CLayer2d& theCOverLayer);
void DrawBackground (const Handle(OpenGl_Workspace)& theWorkspace);
//! Returns list of OpenGL Z-layers.
const OpenGl_LayerList& LayerList() const { return myZLayers; }
//! Returns list of openGL light sources.
const OpenGl_ListOfLight& LightList() const { return myLights; }
//! Returns OpenGL environment map.
const Handle(OpenGl_Texture)& TextureEnv() const { return myTextureEnv; }
//! Returns visualization mode for objects in the view.
Visual3d_TypeOfSurfaceDetail SurfaceDetail() const { return mySurfaceDetail; }
#ifdef HAVE_OPENCL
//! Returns modification state for ray-tracing.
Standard_Size ModificationState() const { return myModificationState; }
#endif
public:
DEFINE_STANDARD_RTTI(OpenGl_View) // Type definition
protected:
void RenderStructs (const Handle(OpenGl_Workspace) &AWorkspace);
void RedrawLayer2d (const Handle(OpenGl_PrinterContext)& thePrintContext,
const Graphic3d_CView& theCView,
const Aspect_CLayer2d& theCLayer);
Handle(OpenGl_Texture) myTextureEnv;
Visual3d_TypeOfSurfaceDetail mySurfaceDetail; //WSSurfaceDetail
Standard_Integer myBackfacing; //WSBackfacing
OPENGL_BG_TEXTURE myBgTexture; //WSBgTexture
OPENGL_BG_GRADIENT myBgGradient; //WSBgGradient
//{ myViewRep
Tmatrix3 myOrientationMatrix;
Tmatrix3 myMappingMatrix;
//Tint shield_indicator;
//TEL_COLOUR shield_colour;
//Tint border_indicator;
//TEL_COLOUR border_colour;
//Tint active_status;
OPENGL_ZCLIP myZClip;
OPENGL_EXTRA_REP myExtra;
//}
Graphic3d_SequenceOfHClipPlane myClipPlanes;
OPENGL_FOG myFog;
OpenGl_Trihedron* myTrihedron;
OpenGl_GraduatedTrihedron* myGraduatedTrihedron;
//View_LABViewContext
int myVisualization;
int myIntShadingMethod;
//View_LABLight
OpenGl_ListOfLight myLights;
//View_LABPlane
//View_LABAliasing
Standard_Boolean myAntiAliasing;
//View_LABDepthCueing - fixed index used
OpenGl_LayerList myZLayers;
const TEL_TRANSFORM_PERSISTENCE *myTransPers;
Standard_Boolean myIsTransPers;
OpenGl_StateCounter* myStateCounter;
Standard_Size myCurrOrientationState; // <-- delete it after merge with new camera
Standard_Size myCurrViewMappingState; // <-- delete it after merge with new camera
Standard_Size myCurrLightSourceState;
typedef std::pair<Standard_Size, Standard_Size> StateInfo;
StateInfo myLastOrientationState;
StateInfo myLastViewMappingState;
StateInfo myLastLightSourceState;
#ifdef HAVE_OPENCL
Standard_Size myModificationState;
#endif
public:
DEFINE_STANDARD_ALLOC
};
#endif //_OpenGl_View_Header
|