Easy3D 2.5.3
ClippingPlane Class Reference

An implementation of a manipulable clipping plane for visualization of model interiors and cross sections. More...

#include <easy3d/renderer/clipping_plane.h>

Public Member Functions

bool is_enabled () const
 returns whether the clipping plane has been enabled.
 
void set_enabled (bool b)
 enables/disables the clipping plane.
 
void fit_scene (const vec3 &center, float radius)
 puts the clipping plane at the center of the scene.
 
vec3 center () const
 the center of the clipping plane. More...
 
vec3 normal () const
 the normal direction of the clipping plane. More...
 
Plane3 plane0 () const
 the clipping plane
 
Plane3 plane1 () const
 the other clipping plane. plane0() and plane1() together define a cross section.
 
bool is_visible () const
 returns whether the clipping plane is visible.
 
void set_visible (bool v)
 shows/hides the clipping plane.
 
const vec4color () const
 returns the color of the clipping plane.
 
void set_color (const vec4 &c)
 sets the color of the clipping plane.
 
bool cross_section () const
 returns whether cross section is enabled.
 
void set_cross_section (bool b)
 enables/disables cross section.
 
float cross_section_width () const
 
void set_cross_section_width (float w)
 sets the thickness of the cross section.
 
void set_program (ShaderProgram *program) const
 
void set_discard_primitives (ShaderProgram *program, bool plane_clipping_discard) const
 
void draw (Camera *cam) const
 draws the clipping plane itself.
 
virtual Manipulatormanipulator ()
 returns the manipulator attached to the clipping plane.
 
virtual const Manipulatormanipulator () const
 returns the manipulator attached to the clipping plane.
 

Static Public Member Functions

static ClippingPlaneinstance ()
 

Detailed Description

An implementation of a manipulable clipping plane for visualization of model interiors and cross sections.

It also provides functions for visualizing the clipping plane itself.

Member Function Documentation

◆ center()

vec3 center ( ) const

the center of the clipping plane.

See also
normal()

◆ cross_section_width()

float cross_section_width ( ) const
inline

returns the thickness of the cross section.

The thickness is defined relative to the scene bounding box. Default value is 0.01.

◆ instance()

ClippingPlane * instance ( )
static

returns the instance of the clipping plane. The entire program will have only one clipping plane.

Examples
visualization_cross_section.

◆ normal()

vec3 normal ( ) const

the normal direction of the clipping plane.

See also
center().

◆ set_discard_primitives()

void set_discard_primitives ( ShaderProgram program,
bool  plane_clipping_discard 
) const

sets up whether a primitive should be completely discarded if one of its vertices is clipped.

Parameters
programThe shader program.
plane_clipping_discardControls clipping plane behavior.
  • true: completely discard a primitive if one of its vertices is clipped by this clipping plane.
  • false: standard plane clipping

◆ set_program()

void set_program ( ShaderProgram program) const

sets up the shader program for rendering.

Parameters
programThe shader program.

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