Skip to content

Viewer Module

3D visualization and interaction.

LightOcct::LContext

Interactive context for Light OCCT viewer Manages display and selection of shapes and interactive objects

cpp
#include <light-occt/viewer/LContext.hxx>

Quick Reference

Methods: Display(), Display(), Display(), Erase(), EraseAll(), Redisplay(), UpdateCurrentViewer(), SetColor(), SetMaterial(), SetTransparency(), SetDisplayMode(), SetLineWidth(), SetSelectionMode(), AddSelectionMode(), RemoveSelectionMode(), ClearSelectionModes(), GetSelectedShapes(), Select(), AddOrRemoveSelected(), ClearSelected(), IsSelected(), NbSelected(), Highlight(), Unhighlight(), IsHighlighted(), GetHighlighted(), SetSelected(), SetCurrentObject(), HasSelectedShape(), FirstSelectedShape(), GetDisplayedShapes(), IsDisplayed(), FitAllObjects(), OpenLocalContext(), CloseLocalContext(), CloseAllContexts(), HasOpenedContext(), SetZLayer(), IsolateShape(), UnisolateAll(), IsValid(), SetPixelTolerance(), GetPixelTolerance(), SetAutoActivateSelection(), GetAutoActivateSelection(), LContext(), ~LContext(), LContext(), operator=()

Enums: DisplayMode, SelectionMode


Methods

Instance Methods

Display
cpp
void Display(const  & LShape shape, bool updateViewer) const;
Display
cpp
void Display(const  & LShape shape, const  & Color color, bool updateViewer) const;
Display
cpp
void Display(const  & LShape shape, const  & Material material, bool updateViewer) const;
Erase
cpp
void Erase(const  & LShape shape, bool updateViewer) const;
EraseAll
cpp
void EraseAll(bool updateViewer) const;
Redisplay
cpp
void Redisplay(const  & LShape shape, bool updateViewer) const;
UpdateCurrentViewer
cpp
void UpdateCurrentViewer() const;
SetColor
cpp
void SetColor(const  & LShape shape, const  & Color color, bool updateViewer) const;
SetMaterial
cpp
void SetMaterial(const  & LShape shape, const  & Material material, bool updateViewer) const;
SetTransparency
cpp
void SetTransparency(const  & LShape shape, double transparency, bool updateViewer) const;
SetDisplayMode
cpp
void SetDisplayMode(const  & LShape shape, DisplayMode mode, bool updateViewer) const;
SetLineWidth
cpp
void SetLineWidth(const  & LShape shape, double width, bool updateViewer) const;
SetSelectionMode
cpp
void SetSelectionMode(SelectionMode mode) const;
AddSelectionMode
cpp
void AddSelectionMode(SelectionMode mode) const;
RemoveSelectionMode
cpp
void RemoveSelectionMode(SelectionMode mode) const;
ClearSelectionModes
cpp
void ClearSelectionModes() const;
GetSelectedShapes
cpp
std::vector<  > LShape GetSelectedShapes() const;
Select
cpp
void Select(const  & LShape shape, bool updateViewer) const;
AddOrRemoveSelected
cpp
void AddOrRemoveSelected(const  & LShape shape, bool updateViewer) const;
ClearSelected
cpp
void ClearSelected(bool updateViewer) const;
IsSelected
cpp
bool IsSelected(const  & LShape shape) const;
NbSelected
cpp
int NbSelected() const;
Highlight
cpp
void Highlight(const  & LShape shape, const  & Color color, bool updateViewer) const;
Unhighlight
cpp
void Unhighlight(const  & LShape shape, bool updateViewer) const;
IsHighlighted
cpp
bool IsHighlighted(const  & LShape shape) const;
GetHighlighted
cpp
std::vector<  > LShape GetHighlighted() const;
SetSelected
cpp
void SetSelected(const  & LShape shape, bool updateViewer) const;
SetCurrentObject
cpp
void SetCurrentObject(const  & LShape shape, bool updateViewer) const;
HasSelectedShape
cpp
bool HasSelectedShape() const;
FirstSelectedShape
cpp
LShape FirstSelectedShape() const;
GetDisplayedShapes
cpp
std::vector<  > LShape GetDisplayedShapes() const;
IsDisplayed
cpp
bool IsDisplayed(const  & LShape shape) const;
FitAllObjects
cpp
void FitAllObjects(const  & LView view, double margin) const;
OpenLocalContext
cpp
void OpenLocalContext(bool useDisplayedObjects, bool allowShapeDecomposition) const;
CloseLocalContext
cpp
void CloseLocalContext(int index, bool updateViewer) const;
CloseAllContexts
cpp
void CloseAllContexts(bool updateViewer) const;
HasOpenedContext
cpp
bool HasOpenedContext() const;
SetZLayer
cpp
void SetZLayer(const  & LShape shape, int layer) const;
IsolateShape
cpp
void IsolateShape(const  & LShape shape, bool updateViewer) const;
UnisolateAll
cpp
void UnisolateAll(bool updateViewer) const;
IsValid
cpp
bool IsValid() const;
SetPixelTolerance
cpp
void SetPixelTolerance(int tolerance) const;
GetPixelTolerance
cpp
int GetPixelTolerance() const;
SetAutoActivateSelection
cpp
void SetAutoActivateSelection(bool enable) const;
GetAutoActivateSelection
cpp
bool GetAutoActivateSelection() const;
LContext
cpp
 LContext() const;
~LContext
cpp
 ~LContext() const;
LContext
cpp
 LContext(const  & LContext other) const;
operator=
cpp
& LContext operator=(const  & LContext other) const;

Enumerations

DisplayMode

cpp
enum DisplayMode {
    DISPLAY_WIREFRAME
    DISPLAY_SHADED
};

SelectionMode

cpp
enum SelectionMode {
    SELECTION_SHAPE
    SELECTION_VERTEX
    SELECTION_EDGE
    SELECTION_WIRE
    SELECTION_FACE
    SELECTION_SHELL
    SELECTION_SOLID
    SELECTION_COMPOUND
};

LightOcct::LView

View class for Light OCCT Represents a single view window in the viewer

cpp
#include <light-occt/viewer/LView.hxx>

Quick Reference

Fields: myProjectionType, myName, myWidth, myHeight

Methods: SetProjection(), GetProjection(), SetViewOrientation(), FitAll(), ZoomWindow(), Pan(), Rotate(), Zoom(), SetZoom(), GetZoom(), SetEye(), SetAt(), SetUp(), GetEye(), GetAt(), GetUp(), StartRotation(), Rotation(), SetScale(), GetScale(), Redraw(), MustBeResized(), UpdateLights(), SetBackgroundColor(), SetGradientBackground(), SetWindow(), SetSize(), GetSize(), IsActive(), Activate(), ShowTrihedron(), SetTrihedronSize(), ShowGraduatedTrihedron(), AddClippingPlane(), RemoveAllClippingPlanes(), SetClippingPlaneActive(), SetShadingModel(), SetVisualization(), EnableAntiAliasing(), Dump(), DumpToImageData(), MoveTo(), Select(), SelectArea(), ClearSelected(), IsValid(), GetName(), LView(), ~LView(), LView(), operator=()

Enums: ProjectionType, ViewOrientation


Fields

myProjectionType

cpp
ProjectionType myProjectionType;

myName

cpp
std::string myName;

myWidth

cpp
int myWidth;

myHeight

cpp
int myHeight;

Methods

Instance Methods

SetProjection
cpp
void SetProjection(ProjectionType type) const;
GetProjection
cpp
ProjectionType GetProjection() const;
SetViewOrientation
cpp
void SetViewOrientation(ViewOrientation orientation) const;
FitAll
cpp
void FitAll(double margin) const;
ZoomWindow
cpp
void ZoomWindow(int x1, int y1, int x2, int y2) const;
Pan
cpp
void Pan(int dx, int dy) const;
Rotate
cpp
void Rotate(int dx, int dy) const;
Zoom
cpp
void Zoom(double factor) const;
SetZoom
cpp
void SetZoom(double zoom) const;
GetZoom
cpp
double GetZoom() const;
SetEye
cpp
void SetEye(const  & Point eye) const;
SetAt
cpp
void SetAt(const  & Point at) const;
SetUp
cpp
void SetUp(const  & Vector up) const;
GetEye
cpp
Point GetEye() const;
GetAt
cpp
Point GetAt() const;
GetUp
cpp
Vector GetUp() const;
StartRotation
cpp
void StartRotation(int x, int y) const;
Rotation
cpp
void Rotation(int x, int y) const;
SetScale
cpp
void SetScale(double scale) const;
GetScale
cpp
double GetScale() const;
Redraw
cpp
void Redraw() const;
MustBeResized
cpp
void MustBeResized() const;
UpdateLights
cpp
void UpdateLights() const;
SetBackgroundColor
cpp
void SetBackgroundColor(const  & Color color) const;
SetGradientBackground
cpp
void SetGradientBackground(const  & Color topColor, const  & Color bottomColor) const;
SetWindow
cpp
void SetWindow(void * windowHandle) const;
SetSize
cpp
void SetSize(int width, int height) const;
GetSize
cpp
void GetSize(int & width, int & height) const;
IsActive
cpp
bool IsActive() const;
Activate
cpp
void Activate() const;
ShowTrihedron
cpp
void ShowTrihedron(bool show) const;
SetTrihedronSize
cpp
void SetTrihedronSize(double size) const;
ShowGraduatedTrihedron
cpp
void ShowGraduatedTrihedron(bool show) const;
AddClippingPlane
cpp
void AddClippingPlane(const  & Point origin, const  & Vector normal) const;
RemoveAllClippingPlanes
cpp
void RemoveAllClippingPlanes() const;
SetClippingPlaneActive
cpp
void SetClippingPlaneActive(int index, bool active) const;
SetShadingModel
cpp
void SetShadingModel(int model) const;
SetVisualization
cpp
void SetVisualization(int mode) const;
EnableAntiAliasing
cpp
void EnableAntiAliasing(bool enable) const;
Dump
cpp
bool Dump(const std::string & filename, int width, int height) const;
DumpToImageData
cpp
bool DumpToImageData(unsigned char * buffer, int width, int height) const;
MoveTo
cpp
void MoveTo(int x, int y) const;
Select
cpp
void Select(int x, int y) const;
SelectArea
cpp
void SelectArea(int x1, int y1, int x2, int y2) const;
ClearSelected
cpp
void ClearSelected() const;
IsValid
cpp
bool IsValid() const;
GetName
cpp
std::string GetName() const;
LView
cpp
 LView() const;
~LView
cpp
 ~LView() const;
LView
cpp
 LView(const  & LView other) const;
operator=
cpp
& LView operator=(const  & LView other) const;

Enumerations

ProjectionType

cpp
enum ProjectionType {
    PROJECTION_ORTHOGRAPHIC
    PROJECTION_PERSPECTIVE
    PROJECTION_STEREO
};

ViewOrientation

cpp
enum ViewOrientation {
    VIEW_TOP
    VIEW_BOTTOM
    VIEW_FRONT
    VIEW_BACK
    VIEW_LEFT
    VIEW_RIGHT
    VIEW_ISOMETRIC
};

LightOcct::LViewer

Main viewer class for Light OCCT Provides high-level interface for 3D visualization

cpp
#include <light-occt/viewer/LViewer.hxx>

Quick Reference

Fields: myType, myRenderingMode, myName

Factory Methods: CreateDesktopViewer()

Methods: CreateView(), RemoveView(), UpdateAllViews(), SetDefaultLighting(), AddDirectionalLight(), AddAmbientLight(), RemoveAllLights(), SetGradientBackground(), SetSolidBackground(), ShowGrid(), SetGridSpacing(), SetGridColor(), GetType(), IsValid(), GetName(), SetRenderingMode(), GetRenderingMode(), SetAntiAliasing(), SetShadows(), GetContext(), LViewer(), ~LViewer(), LViewer(), operator=()

Enums: ViewerType, RenderingMode


Fields

myType

cpp
ViewerType myType;

myRenderingMode

cpp
RenderingMode myRenderingMode;

myName

cpp
std::string myName;

Methods

Factory Methods

CreateDesktopViewer
cpp
static LViewer CreateDesktopViewer(const std::string & name);

Instance Methods

CreateView
cpp
LView CreateView(const std::string & name, int x, int y, int width, int height) const;
RemoveView
cpp
void RemoveView(const  & LView view) const;
UpdateAllViews
cpp
void UpdateAllViews() const;
SetDefaultLighting
cpp
void SetDefaultLighting() const;
AddDirectionalLight
cpp
void AddDirectionalLight(const  & Vector direction, const  & Color color) const;
AddAmbientLight
cpp
void AddAmbientLight(const  & Color color, double intensity) const;
RemoveAllLights
cpp
void RemoveAllLights() const;
SetGradientBackground
cpp
void SetGradientBackground(const  & Color topColor, const  & Color bottomColor) const;
SetSolidBackground
cpp
void SetSolidBackground(const  & Color color) const;
ShowGrid
cpp
void ShowGrid(bool show) const;
SetGridSpacing
cpp
void SetGridSpacing(double spacing) const;
SetGridColor
cpp
void SetGridColor(const  & Color color) const;
GetType
cpp
ViewerType GetType() const;
IsValid
cpp
bool IsValid() const;
GetName
cpp
std::string GetName() const;
SetRenderingMode
cpp
void SetRenderingMode(RenderingMode mode) const;
GetRenderingMode
cpp
RenderingMode GetRenderingMode() const;
SetAntiAliasing
cpp
void SetAntiAliasing(bool enable) const;
SetShadows
cpp
void SetShadows(bool enable) const;
GetContext
cpp
LContext GetContext() const;
LViewer
cpp
 LViewer() const;
~LViewer
cpp
 ~LViewer() const;
LViewer
cpp
 LViewer(const  & LViewer other) const;
operator=
cpp
& LViewer operator=(const  & LViewer other) const;

Enumerations

ViewerType

cpp
enum ViewerType {
    VIEWER_DESKTOP
    VIEWER_WEBGL
};

RenderingMode

cpp
enum RenderingMode {
    RENDERING_WIREFRAME
    RENDERING_SHADED
    RENDERING_SHADED_WITH_EDGES
};

Released under the LGPL-2.1 License