ACloudViewer  3.9.4
A Modern Library for 3D Data Processing
cloudViewer::visualization::RenderOption Class Reference

Defines rendering options for visualizer. More...

#include <RenderOption.h>

Inheritance diagram for cloudViewer::visualization::RenderOption:
Collaboration diagram for cloudViewer::visualization::RenderOption:

Public Types

enum class  TextureInterpolationOption { Nearest = 0 , Linear = 1 }
 
enum class  DepthFunc {
  Never = 0 , Less = 1 , Equal = 2 , LEqual = 3 ,
  Greater = 4 , NotEqual = 5 , GEqual = 6 , Always = 7
}
 
enum class  PointColorOption {
  Default = 0 , Color = 1 , XCoordinate = 2 , YCoordinate = 3 ,
  ZCoordinate = 4 , Normal = 9
}
 Enum class for point color for PointCloud. More...
 
enum class  MeshShadeOption { FlatShade = 0 , SmoothShade = 1 }
 Enum class for mesh shading for TriangleMesh. More...
 
enum class  MeshColorOption {
  Default = 0 , Color = 1 , XCoordinate = 2 , YCoordinate = 3 ,
  ZCoordinate = 4 , Normal = 9
}
 Enum class for color for TriangleMesh. More...
 
enum class  ImageStretchOption { OriginalSize = 0 , StretchKeepRatio = 1 , StretchWithWindow = 2 }
 

Public Member Functions

 RenderOption ()
 Default Constructor. More...
 
 ~RenderOption () override
 
bool ConvertToJsonValue (Json::Value &value) const override
 
bool ConvertFromJsonValue (const Json::Value &value) override
 
void ToggleLightOn ()
 
void ToggleInterpolationOption ()
 
void ChangePointSize (double change)
 
void SetPointSize (double size)
 
void ChangeLineWidth (double change)
 
void TogglePointShowNormal ()
 
void ToggleShadingOption ()
 
void ToggleMeshShowBackFace ()
 
void ToggleMeshShowWireframe ()
 
void ToggleImageStretchOption ()
 
int GetGLDepthFunc () const
 
- Public Member Functions inherited from cloudViewer::utility::IJsonConvertible
virtual ~IJsonConvertible ()
 
virtual std::string ToString () const
 Convert to a styled string representation of JSON data for display. More...
 

Public Attributes

const double POINT_SIZE_MAX = 25.0
 
const double POINT_SIZE_MIN = 1.0
 
const double POINT_SIZE_STEP = 1.0
 
const double POINT_SIZE_DEFAULT = 5.0
 
const double LINE_WIDTH_MAX = 10.0
 
const double LINE_WIDTH_MIN = 1.0
 
const double LINE_WIDTH_STEP = 1.0
 
const double LINE_WIDTH_DEFAULT = 1.0
 
Eigen::Vector3d background_color_ = Eigen::Vector3d::Ones()
 Background RGB color. More...
 
TextureInterpolationOption interpolation_option_
 
DepthFunc depthFunc_ = DepthFunc::Less
 
bool light_on_ = true
 Whether to turn on Phong lighting. More...
 
Eigen::Vector3d light_position_relative_ [4]
 
Eigen::Vector3d light_color_ [4]
 
Eigen::Vector3d light_ambient_color_ = Eigen::Vector3d::Zero()
 
double light_diffuse_power_ [4]
 
double light_specular_power_ [4]
 
double light_specular_shininess_ [4]
 
double point_size_ = POINT_SIZE_DEFAULT
 Point size for PointCloud. More...
 
PointColorOption point_color_option_ = PointColorOption::Default
 Point color option for PointCloud. More...
 
bool point_show_normal_ = false
 Whether to show normal for PointCloud. More...
 
MeshShadeOption mesh_shade_option_ = MeshShadeOption::FlatShade
 Mesh shading option for TriangleMesh. More...
 
MeshColorOption mesh_color_option_ = MeshColorOption::Color
 Color option for TriangleMesh. More...
 
bool mesh_show_back_face_ = false
 Whether to show back faces for TriangleMesh. More...
 
bool mesh_show_wireframe_ = false
 
Eigen::Vector3d default_mesh_color_ = Eigen::Vector3d(0.7, 0.7, 0.7)
 
double line_width_ = LINE_WIDTH_DEFAULT
 Line width for LineSet. More...
 
ImageStretchOption image_stretch_option_
 
int image_max_depth_ = 3000
 
bool show_coordinate_frame_ = false
 Whether to show coordinate frame. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from cloudViewer::utility::IJsonConvertible
static bool EigenVector3dFromJsonArray (Eigen::Vector3d &vec, const Json::Value &value)
 
static bool EigenVector3dToJsonArray (const Eigen::Vector3d &vec, Json::Value &value)
 
static bool EigenVector4dFromJsonArray (Eigen::Vector4d &vec, const Json::Value &value)
 
static bool EigenVector4dToJsonArray (const Eigen::Vector4d &vec, Json::Value &value)
 
static bool EigenMatrix3dFromJsonArray (Eigen::Matrix3d &mat, const Json::Value &value)
 
static bool EigenMatrix3dToJsonArray (const Eigen::Matrix3d &mat, Json::Value &value)
 
static bool EigenMatrix4dFromJsonArray (Eigen::Matrix4d &mat, const Json::Value &value)
 
static bool EigenMatrix4dToJsonArray (const Eigen::Matrix4d &mat, Json::Value &value)
 
static bool EigenMatrix4dFromJsonArray (Eigen::Matrix4d_u &mat, const Json::Value &value)
 
static bool EigenMatrix4dToJsonArray (const Eigen::Matrix4d_u &mat, Json::Value &value)
 
static bool EigenMatrix6dFromJsonArray (Eigen::Matrix6d &mat, const Json::Value &value)
 
static bool EigenMatrix6dToJsonArray (const Eigen::Matrix6d &mat, Json::Value &value)
 
static bool EigenMatrix6dFromJsonArray (Eigen::Matrix6d_u &mat, const Json::Value &value)
 
static bool EigenMatrix6dToJsonArray (const Eigen::Matrix6d_u &mat, Json::Value &value)
 

Detailed Description

Defines rendering options for visualizer.

Definition at line 20 of file RenderOption.h.

Member Enumeration Documentation

◆ DepthFunc

Enumerator
Never 
Less 
Equal 
LEqual 
Greater 
NotEqual 
GEqual 
Always 

Definition at line 28 of file RenderOption.h.

◆ ImageStretchOption

Enumerator
OriginalSize 
StretchKeepRatio 
StretchWithWindow 

Definition at line 81 of file RenderOption.h.

◆ MeshColorOption

Enum class for color for TriangleMesh.

Enumerator
Default 
Color 
XCoordinate 
YCoordinate 
ZCoordinate 
Normal 

Definition at line 71 of file RenderOption.h.

◆ MeshShadeOption

Enum class for mesh shading for TriangleMesh.

Enumerator
FlatShade 
SmoothShade 

Definition at line 63 of file RenderOption.h.

◆ PointColorOption

Enum class for point color for PointCloud.

Enumerator
Default 
Color 
XCoordinate 
YCoordinate 
ZCoordinate 
Normal 

Definition at line 42 of file RenderOption.h.

◆ TextureInterpolationOption

Enumerator
Nearest 
Linear 

Definition at line 23 of file RenderOption.h.

Constructor & Destructor Documentation

◆ RenderOption()

cloudViewer::visualization::RenderOption::RenderOption ( )
inline

◆ ~RenderOption()

cloudViewer::visualization::RenderOption::~RenderOption ( )
inlineoverride

Definition at line 113 of file RenderOption.h.

Member Function Documentation

◆ ChangeLineWidth()

void cloudViewer::visualization::RenderOption::ChangeLineWidth ( double  change)

Definition at line 239 of file RenderOption.cpp.

References line_width_, LINE_WIDTH_MAX, LINE_WIDTH_MIN, LINE_WIDTH_STEP, max(), and min().

◆ ChangePointSize()

void cloudViewer::visualization::RenderOption::ChangePointSize ( double  change)

Definition at line 229 of file RenderOption.cpp.

References max(), min(), point_size_, POINT_SIZE_MAX, POINT_SIZE_MIN, and POINT_SIZE_STEP.

◆ ConvertFromJsonValue()

◆ ConvertToJsonValue()

◆ GetGLDepthFunc()

int cloudViewer::visualization::RenderOption::GetGLDepthFunc ( ) const

Definition at line 245 of file RenderOption.cpp.

References Always, depthFunc_, Equal, GEqual, Greater, LEqual, Less, Never, and NotEqual.

◆ SetPointSize()

void cloudViewer::visualization::RenderOption::SetPointSize ( double  size)

◆ ToggleImageStretchOption()

void cloudViewer::visualization::RenderOption::ToggleImageStretchOption ( )
inline

◆ ToggleInterpolationOption()

void cloudViewer::visualization::RenderOption::ToggleInterpolationOption ( )
inline

Definition at line 121 of file RenderOption.h.

References interpolation_option_, Linear, and Nearest.

◆ ToggleLightOn()

void cloudViewer::visualization::RenderOption::ToggleLightOn ( )
inline

Definition at line 120 of file RenderOption.h.

References light_on_.

◆ ToggleMeshShowBackFace()

void cloudViewer::visualization::RenderOption::ToggleMeshShowBackFace ( )
inline

Definition at line 139 of file RenderOption.h.

References mesh_show_back_face_.

◆ ToggleMeshShowWireframe()

void cloudViewer::visualization::RenderOption::ToggleMeshShowWireframe ( )
inline

Definition at line 142 of file RenderOption.h.

References mesh_show_wireframe_.

◆ TogglePointShowNormal()

void cloudViewer::visualization::RenderOption::TogglePointShowNormal ( )
inline

Definition at line 131 of file RenderOption.h.

References point_show_normal_.

◆ ToggleShadingOption()

void cloudViewer::visualization::RenderOption::ToggleShadingOption ( )
inline

Definition at line 132 of file RenderOption.h.

References FlatShade, mesh_shade_option_, and SmoothShade.

Member Data Documentation

◆ background_color_

Eigen::Vector3d cloudViewer::visualization::RenderOption::background_color_ = Eigen::Vector3d::Ones()

Background RGB color.

Definition at line 161 of file RenderOption.h.

Referenced by ConvertFromJsonValue(), ConvertToJsonValue(), and cloudViewer::visualization::pybind_renderoption().

◆ default_mesh_color_

Eigen::Vector3d cloudViewer::visualization::RenderOption::default_mesh_color_ = Eigen::Vector3d(0.7, 0.7, 0.7)

Definition at line 193 of file RenderOption.h.

Referenced by ConvertFromJsonValue(), and ConvertToJsonValue().

◆ depthFunc_

DepthFunc cloudViewer::visualization::RenderOption::depthFunc_ = DepthFunc::Less

Definition at line 164 of file RenderOption.h.

Referenced by GetGLDepthFunc().

◆ image_max_depth_

int cloudViewer::visualization::RenderOption::image_max_depth_ = 3000

Definition at line 202 of file RenderOption.h.

Referenced by ConvertFromJsonValue(), and ConvertToJsonValue().

◆ image_stretch_option_

ImageStretchOption cloudViewer::visualization::RenderOption::image_stretch_option_

◆ interpolation_option_

◆ light_ambient_color_

Eigen::Vector3d cloudViewer::visualization::RenderOption::light_ambient_color_ = Eigen::Vector3d::Zero()

Definition at line 171 of file RenderOption.h.

Referenced by ConvertFromJsonValue(), and ConvertToJsonValue().

◆ light_color_

Eigen::Vector3d cloudViewer::visualization::RenderOption::light_color_[4]

Definition at line 170 of file RenderOption.h.

Referenced by ConvertFromJsonValue(), ConvertToJsonValue(), and RenderOption().

◆ light_diffuse_power_

double cloudViewer::visualization::RenderOption::light_diffuse_power_[4]

Definition at line 172 of file RenderOption.h.

Referenced by ConvertFromJsonValue(), ConvertToJsonValue(), and RenderOption().

◆ light_on_

bool cloudViewer::visualization::RenderOption::light_on_ = true

Whether to turn on Phong lighting.

Definition at line 168 of file RenderOption.h.

Referenced by ConvertFromJsonValue(), ConvertToJsonValue(), cloudViewer::visualization::pybind_renderoption(), and ToggleLightOn().

◆ light_position_relative_

Eigen::Vector3d cloudViewer::visualization::RenderOption::light_position_relative_[4]

Definition at line 169 of file RenderOption.h.

Referenced by ConvertFromJsonValue(), ConvertToJsonValue(), and RenderOption().

◆ light_specular_power_

double cloudViewer::visualization::RenderOption::light_specular_power_[4]

Definition at line 173 of file RenderOption.h.

Referenced by ConvertFromJsonValue(), ConvertToJsonValue(), and RenderOption().

◆ light_specular_shininess_

double cloudViewer::visualization::RenderOption::light_specular_shininess_[4]

Definition at line 174 of file RenderOption.h.

Referenced by ConvertFromJsonValue(), ConvertToJsonValue(), and RenderOption().

◆ line_width_

double cloudViewer::visualization::RenderOption::line_width_ = LINE_WIDTH_DEFAULT

◆ LINE_WIDTH_DEFAULT

const double cloudViewer::visualization::RenderOption::LINE_WIDTH_DEFAULT = 1.0

Definition at line 58 of file RenderOption.h.

◆ LINE_WIDTH_MAX

const double cloudViewer::visualization::RenderOption::LINE_WIDTH_MAX = 10.0

Definition at line 55 of file RenderOption.h.

Referenced by ChangeLineWidth().

◆ LINE_WIDTH_MIN

const double cloudViewer::visualization::RenderOption::LINE_WIDTH_MIN = 1.0

Definition at line 56 of file RenderOption.h.

Referenced by ChangeLineWidth().

◆ LINE_WIDTH_STEP

const double cloudViewer::visualization::RenderOption::LINE_WIDTH_STEP = 1.0

Definition at line 57 of file RenderOption.h.

Referenced by ChangeLineWidth().

◆ mesh_color_option_

MeshColorOption cloudViewer::visualization::RenderOption::mesh_color_option_ = MeshColorOption::Color

Color option for TriangleMesh.

Definition at line 188 of file RenderOption.h.

Referenced by ConvertFromJsonValue(), ConvertToJsonValue(), and cloudViewer::visualization::pybind_renderoption().

◆ mesh_shade_option_

MeshShadeOption cloudViewer::visualization::RenderOption::mesh_shade_option_ = MeshShadeOption::FlatShade

Mesh shading option for TriangleMesh.

Definition at line 186 of file RenderOption.h.

Referenced by ConvertFromJsonValue(), ConvertToJsonValue(), cloudViewer::visualization::pybind_renderoption(), and ToggleShadingOption().

◆ mesh_show_back_face_

bool cloudViewer::visualization::RenderOption::mesh_show_back_face_ = false

◆ mesh_show_wireframe_

bool cloudViewer::visualization::RenderOption::mesh_show_wireframe_ = false

◆ point_color_option_

PointColorOption cloudViewer::visualization::RenderOption::point_color_option_ = PointColorOption::Default

Point color option for PointCloud.

Definition at line 180 of file RenderOption.h.

Referenced by ConvertFromJsonValue(), ConvertToJsonValue(), and cloudViewer::visualization::pybind_renderoption().

◆ point_show_normal_

bool cloudViewer::visualization::RenderOption::point_show_normal_ = false

◆ point_size_

◆ POINT_SIZE_DEFAULT

const double cloudViewer::visualization::RenderOption::POINT_SIZE_DEFAULT = 5.0

Definition at line 54 of file RenderOption.h.

◆ POINT_SIZE_MAX

const double cloudViewer::visualization::RenderOption::POINT_SIZE_MAX = 25.0

Definition at line 51 of file RenderOption.h.

Referenced by ChangePointSize(), and SetPointSize().

◆ POINT_SIZE_MIN

const double cloudViewer::visualization::RenderOption::POINT_SIZE_MIN = 1.0

Definition at line 52 of file RenderOption.h.

Referenced by ChangePointSize(), and SetPointSize().

◆ POINT_SIZE_STEP

const double cloudViewer::visualization::RenderOption::POINT_SIZE_STEP = 1.0

Definition at line 53 of file RenderOption.h.

Referenced by ChangePointSize().

◆ show_coordinate_frame_

bool cloudViewer::visualization::RenderOption::show_coordinate_frame_ = false

Whether to show coordinate frame.

Definition at line 206 of file RenderOption.h.

Referenced by ConvertFromJsonValue(), ConvertToJsonValue(), main(), and cloudViewer::visualization::pybind_renderoption().


The documentation for this class was generated from the following files: