HPS::CullingControl Class Reference

#include <hps.h>

Inheritance diagram for HPS::CullingControl:
HPS::Control HPS::Object

Public Member Functions

 CullingControl (SegmentKey &in_seg)
 
 CullingControl (CullingControl const &in_that)
 
 CullingControl (CullingControl &&in_that)
 
HPS::Type ObjectType () const
 
CullingControloperator= (CullingControl &&in_that)
 
CullingControloperator= (CullingControl const &in_that)
 
CullingControlSetBackFace (bool in_state)
 
CullingControlSetDeferralExtent (bool in_state, unsigned int in_pixels)
 
CullingControlSetDeferralExtent (unsigned int in_pixels)
 
CullingControlSetDistance (bool in_state, float in_max_distance)
 
CullingControlSetDistance (float in_max_distance)
 
CullingControlSetExtent (bool in_state, unsigned int in_pixels)
 
CullingControlSetExtent (unsigned int in_pixels)
 
CullingControlSetFrustum (bool in_state)
 
CullingControlSetVector (bool in_state, HPS::Vector const &in_vector, float in_tolerance_degrees)
 
CullingControlSetVector (HPS::Vector const &in_vector, float in_tolerance_degrees)
 
CullingControlSetVector (bool in_state, HPS::Vector const &in_vector=Vector(0.0f, 0.0f, 1.0f))
 
CullingControlSetVector (HPS::Vector const &in_vector)
 
CullingControlSetVectorTolerance (float in_tolerance_degrees)
 
CullingControlSetVolume (bool in_state, HPS::SimpleCuboid const &in_volume=HPS::SimpleCuboid())
 
CullingControlSetVolume (HPS::SimpleCuboid const &in_volume)
 
bool ShowBackFace (bool &out_state) const
 
bool ShowDeferralExtent (bool &out_state, unsigned int &out_pixels) const
 
bool ShowDistance (bool &out_state, float &out_max_distance) const
 
bool ShowExtent (bool &out_state, unsigned int &out_pixels) const
 
bool ShowFrustum (bool &out_state) const
 
bool ShowVector (bool &out_state, HPS::Vector &out_vector) const
 
bool ShowVectorTolerance (float &out_tolerance_degrees) const
 
bool ShowVolume (bool &out_state, HPS::SimpleCuboid &out_volume) const
 
virtual HPS::Type Type () const
 
CullingControlUnsetBackFace ()
 
CullingControlUnsetDeferralExtent ()
 
CullingControlUnsetDistance ()
 
CullingControlUnsetEverything ()
 
CullingControlUnsetExtent ()
 
CullingControlUnsetFrustum ()
 
CullingControlUnsetVector ()
 
CullingControlUnsetVectorTolerance ()
 
CullingControlUnsetVolume ()
 
 ~CullingControl ()
 
- Public Member Functions inherited from HPS::Object
virtual bool Empty () const
 
intptr_t GetClassID () const
 
intptr_t GetInstanceID () const
 
bool HasType (HPS::Type in_mask) const
 
 Object (Object const &that)
 
 Object (Object &&in_that)
 
Objectoperator= (Object const &other_object)
 
Objectoperator= (Object &&in_that)
 
virtual void Reset ()
 

Static Public Attributes

static const HPS::Type staticType = HPS::Type::CullingControl
 
- Static Public Attributes inherited from HPS::Control
static const HPS::Type staticType = HPS::Type::Control
 
- Static Public Attributes inherited from HPS::Object
static const HPS::Type staticType = HPS::Type::None
 

Additional Inherited Members

- Static Public Member Functions inherited from HPS::Object
template<typename T >
static intptr_t ClassID ()
 
- Protected Member Functions inherited from HPS::Control
 Control (Control &&in_that)
 
Controloperator= (Control &&in_that)
 

Detailed Description

The HPS::CullingControl class is a smart pointer that is tied to a database object. Using this object, you are able to control the various options related to culling, such as enabling or disabling back face culling, vector culling, and frustum culling. This table lists default values for the various segment attributes accessible from HPS::CullingControl.

Constructor & Destructor Documentation

◆ CullingControl() [1/3]

HPS::CullingControl::CullingControl ( SegmentKey in_seg)
explicit

Initializes a control tied to the segment in_seg.

◆ CullingControl() [2/3]

HPS::CullingControl::CullingControl ( CullingControl const &  in_that)

Initializes a control tied to the same object as in_that.

◆ ~CullingControl()

HPS::CullingControl::~CullingControl ( )

Releases a reference to the database object this control is tied to.

◆ CullingControl() [3/3]

HPS::CullingControl::CullingControl ( CullingControl &&  in_that)

The move constructor creates a CullingControl by transferring the underlying impl of the rvalue reference to this CullingControl thereby avoiding a copy and allocation.

Parameters
in_thatAn rvalue reference to a CullingControl to take the impl from.

Member Function Documentation

◆ ObjectType()

HPS::Type HPS::CullingControl::ObjectType ( ) const
inlinevirtual

This function returns the type the object, as declared (if the object is derived, this does not give the true type of the derived object).

Returns
The declared type of the object in question, which may differ from the true, underlying type.

Reimplemented from HPS::Control.

◆ operator=() [1/2]

CullingControl& HPS::CullingControl::operator= ( CullingControl &&  in_that)

The move assignment operator transfers the underlying impl of the rvalue reference to this CullingControl thereby avoiding a copy.

Parameters
in_thatAn rvalue reference to a CullingControl to take the impl from.
Returns
A reference to this CullingControl.

◆ operator=() [2/2]

CullingControl& HPS::CullingControl::operator= ( CullingControl const &  in_that)

Share the underlying smart-pointer of the CullingControl source.

Parameters
in_thatThe CullingControl source of the assignment.
Returns
A reference to this CullingControl.

◆ SetBackFace()

CullingControl& HPS::CullingControl::SetBackFace ( bool  in_state)

Controls whether faces with normals that point away from the camera should be culled. This option can only be effective if a polygon handedness is defined.

Parameters
in_stateWhether faces with normals that point away from the camera should be culled.
Returns
A reference to this object.

◆ SetDeferralExtent() [1/2]

CullingControl& HPS::CullingControl::SetDeferralExtent ( bool  in_state,
unsigned int  in_pixels 
)

Controls whether geometry that falls below a certain size should be deferred. This setting only becomes relevant in timed updates (or fixed-framerate) when deferred geometry is given a lower priority. During non-timed updates no geometry is deferred, regardless of this setting.

Parameters
in_stateWhether deferral culling should be enabled.
in_pixelsThe number of pixels below which geometry should be deferred.
Returns
A reference to this object.

◆ SetDeferralExtent() [2/2]

CullingControl& HPS::CullingControl::SetDeferralExtent ( unsigned int  in_pixels)

Controls whether geometry that falls below a certain size should be deferred. This setting only becomes relevant in timed updates (or fixed-framerate) when deferred geometry is given a lower priority. During non-timed updates no geometry is deferred, regardless of this setting.

Parameters
in_stateWhether deferral culling should be enabled.
in_pixelsThe number of pixels below which geometry should be deferred.
Returns
A reference to this object.

◆ SetDistance() [1/2]

CullingControl& HPS::CullingControl::SetDistance ( bool  in_state,
float  in_max_distance 
)

Controls state of distance culling. When using distance culling geometries that lie farther away from the camera than specified in in_max_distance will be culled. in_max_distance is specified in world units.

Parameters
in_stateWhether to use distance culling.
in_max_distanceThe maximum distance from the camera after which geometries will be culled.
Returns
A reference to this object.

◆ SetDistance() [2/2]

CullingControl& HPS::CullingControl::SetDistance ( float  in_max_distance)

Controls state of distance culling. This function implicitly enables distance culling. When using distance culling geometries that lie farther away from the camera than specified in in_max_distance will be culled. in_max_distance is specified in world units.

Parameters
in_max_distanceThe maximum distance from the camera after which geometries will be culled.
Returns
A reference to this object.

◆ SetExtent() [1/2]

CullingControl& HPS::CullingControl::SetExtent ( bool  in_state,
unsigned int  in_pixels 
)

Controls whether geometry that falls below a certain size should be culled.

Parameters
in_stateWhether extent culling should be enabled.
in_pixelsThe longest dimension of the screen-space projection of the bounding-volume, in pixels.
Returns
A reference to this object.

◆ SetExtent() [2/2]

CullingControl& HPS::CullingControl::SetExtent ( unsigned int  in_pixels)

Controls whether geometry that falls below a certain size should be culled. This function implicitly enables extent culling.

Parameters
in_pixelsThe longest dimension of the screen-space projection of the bounding-volume, in pixels.
Returns
A reference to this object.

◆ SetFrustum()

CullingControl& HPS::CullingControl::SetFrustum ( bool  in_state)

Controls whether geometry outside the current view frustum should be culled.

Parameters
in_stateWhether geometry outside the current view frustum should be culled.
Returns
A reference to this object.

◆ SetVector() [1/4]

CullingControl& HPS::CullingControl::SetVector ( bool  in_state,
HPS::Vector const &  in_vector,
float  in_tolerance_degrees 
)

Controls the state of vector culling. If the angle between the specified vector and the current view vector is less than the angle defined, then a segment with vector culling enabled will not be drawn.

Parameters
in_stateWhether to use vector culling.
in_vectorThe reference vector to compare the view vector to.
in_tolerance_degreesThe upper limit, in degrees, between the reference vector and the view vector.
Returns
A reference to this object.

◆ SetVector() [2/4]

CullingControl& HPS::CullingControl::SetVector ( HPS::Vector const &  in_vector,
float  in_tolerance_degrees 
)

Controls the state of vector culling. If the angle between the specified vector and the current view vector is less than the angle defined, then a segment with vector culling enabled will not be drawn. This function implicitly enables extent culling.

Parameters
in_vectorThe reference vector to compare the view vector to.
in_tolerance_degreesThe upper limit, in degrees, between the reference vector and the view vector.
Returns
A reference to this object.

◆ SetVector() [3/4]

CullingControl& HPS::CullingControl::SetVector ( bool  in_state,
HPS::Vector const &  in_vector = Vector(0.0f, 0.0f, 1.0f) 
)

Controls the state of vector culling. If the angle between the specified vector and the current view vector is less than the angle defined, then a segment with vector culling enabled will not be drawn. This function does not modify the vector tolerance.

Parameters
in_stateWhether to use vector culling.
in_vectorThe reference vector to compare the view vector to.
Returns
A reference to this object.

◆ SetVector() [4/4]

CullingControl& HPS::CullingControl::SetVector ( HPS::Vector const &  in_vector)

Controls the state of vector culling. If the angle between the specified vector and the current view vector is less than the angle defined, then a segment with vector culling enabled will not be drawn. This function implicitly enables extent culling and does not modify the vector tolerance.

Parameters
in_vectorThe reference vector to compare the view vector to.
Returns
A reference to this object.

◆ SetVectorTolerance()

CullingControl& HPS::CullingControl::SetVectorTolerance ( float  in_tolerance_degrees)

Adjusts the tolerance value used in vector culling. This setting will have no effect is vector culling is not enabled.

Parameters
in_tolerance_degreesThe upper limit, in degrees, between the reference vector and the view vector.
Returns
A reference to this object.

◆ SetVolume() [1/2]

CullingControl& HPS::CullingControl::SetVolume ( bool  in_state,
HPS::SimpleCuboid const &  in_volume = HPS::SimpleCuboid() 
)

Controls state of volume culling. When using volume culling segments whose bounding not inscribed and does not intersect the volume specified by in_volume will be culled. The points of the cuboid passed to this function need to be specified in world units.

Parameters
in_stateWhether to use volume culling.
in_volumeA cuboid used to describe a world-space volume.
Returns
A reference to this object.

◆ SetVolume() [2/2]

CullingControl& HPS::CullingControl::SetVolume ( HPS::SimpleCuboid const &  in_volume)

Controls state of volume culling. When using volume culling segments whose bounding not inscribed and does not intersect the volume specified by in_volume will be culled. The points of the cuboid passed to this function need to be specified in world units.

Parameters
in_volumeA cuboid used to describe a world-space volume.
Returns
A reference to this object.

◆ ShowBackFace()

bool HPS::CullingControl::ShowBackFace ( bool &  out_state) const

Shows whether faces with normals that point away from the camera should be culled.

Parameters
out_stateWhether faces with normals that point away from the camera should be culled.
Returns
true if the setting is valid, false otherwise.

◆ ShowDeferralExtent()

bool HPS::CullingControl::ShowDeferralExtent ( bool &  out_state,
unsigned int &  out_pixels 
) const

Shows whether geometry that falls below a certain size should be deferred.

Parameters
out_stateWhether deferral culling should be enabled.
out_pixelsThe number of pixels below which geometry should be deferred.
Returns
true if the setting is valid, false otherwise.

◆ ShowDistance()

bool HPS::CullingControl::ShowDistance ( bool &  out_state,
float &  out_max_distance 
) const

Shows the state of distance culling. When distance culling is active, geometries that lie farther away from the camera than out_max_distance will be culled.

Parameters
out_stateWhether distance culling is being used.
out_max_distanceThe maximum distance away from the camera before geometries are culled.
Returns
true if the setting is valid, false otherwise.

◆ ShowExtent()

bool HPS::CullingControl::ShowExtent ( bool &  out_state,
unsigned int &  out_pixels 
) const

Shows whether geometry that falls below a certain size should be culled.

Parameters
out_stateWhether extent culling should be enabled.
out_pixelsThe longest dimension of the screen-space projection of the bounding-volume, in pixels.
Returns
true if the setting is valid, false otherwise.

◆ ShowFrustum()

bool HPS::CullingControl::ShowFrustum ( bool &  out_state) const

Shows whether geometry outside the current view frustum should be culled.

Parameters
out_stateWhether geometry outside the current view frustum should be culled.
Returns
true if the setting is valid, false otherwise.

◆ ShowVector()

bool HPS::CullingControl::ShowVector ( bool &  out_state,
HPS::Vector out_vector 
) const

Shows the state of vector culling. If the angle between the specified vector and the current view vector is less than the angle defined, then a segment with vector culling enabled will not be drawn.

Parameters
out_stateWhether to use vector culling.
out_vectorThe reference vector to compare the view vector to.
Returns
true if the setting is valid, false otherwise.

◆ ShowVectorTolerance()

bool HPS::CullingControl::ShowVectorTolerance ( float &  out_tolerance_degrees) const

Shows the tolerance value used in vector culling. This setting will have no effect is vector culling is not enabled.

Parameters
out_tolerance_degreesThe upper limit, in degrees, between the reference vector and the view vector.
Returns
true if the setting is valid, false otherwise.

◆ ShowVolume()

bool HPS::CullingControl::ShowVolume ( bool &  out_state,
HPS::SimpleCuboid out_volume 
) const

Shows the state of volume culling. When volume culling is active, segments whose bounding is not inscribed or intersecting out_volume will be culled.

Parameters
out_stateWhether volume culling is being used.
out_volumeA cuboid defining a world-space volume.
Returns
true if the setting is valid, false otherwise.

◆ Type()

virtual HPS::Type HPS::CullingControl::Type ( ) const
inlinevirtual

This function returns the true type of the underlying object. This function is useful for finding the type of smart pointer objects that have been cast to more generic types.

Warning
This function must synchronize the database (by waiting for all pending database operations to complete) in order to know the type status of this object with certainty. Therefore this function can negatively impact performance. You should vigorously avoid using this function in high-traffic or peformance-critical areas of your code.
Returns
The true type of the object in question.

Reimplemented from HPS::Control.

◆ UnsetBackFace()

CullingControl& HPS::CullingControl::UnsetBackFace ( )

Removes the back face culling setting. If the control is attached to a WindowKey this function restores the default value of this setting as specified by CullingKit::GetDefault().

Returns
A reference to this object.

◆ UnsetDeferralExtent()

CullingControl& HPS::CullingControl::UnsetDeferralExtent ( )

Removes the extent culling setting. If the control is attached to a WindowKey this function restores the default value of this setting as specified by CullingKit::GetDefault().

Returns
A reference to this object.

◆ UnsetDistance()

CullingControl& HPS::CullingControl::UnsetDistance ( )

Removes the distance culling setting. If the control is attached to a WindowKey this function restores the default value of this setting as specified by CullingKit::GetDefault().

Returns
A reference to this object.

◆ UnsetEverything()

CullingControl& HPS::CullingControl::UnsetEverything ( )

Removes all settings from this object. If the control is attached to a WindowKey this function restores the default settings of this control as specified by CullingKit::GetDefault().

Returns
A reference to this object.

◆ UnsetExtent()

CullingControl& HPS::CullingControl::UnsetExtent ( )

Removes the extent culling setting. If the control is attached to a WindowKey this function restores the default value of this setting as specified by CullingKit::GetDefault().

Returns
A reference to this object.

◆ UnsetFrustum()

CullingControl& HPS::CullingControl::UnsetFrustum ( )

Removes the frustum culling setting. If the control is attached to a WindowKey this function restores the default value of this setting as specified by CullingKit::GetDefault().

Returns
A reference to this object.

◆ UnsetVector()

CullingControl& HPS::CullingControl::UnsetVector ( )

Removes the vector culling setting while leaving the vector tolerance unmodified. If the control is attached to a WindowKey this function restores the default value of this setting as specified by CullingKit::GetDefault().

Returns
A reference to this object.

◆ UnsetVectorTolerance()

CullingControl& HPS::CullingControl::UnsetVectorTolerance ( )

Removes the vector culling tolerance setting only. If the control is attached to a WindowKey this function restores the default value of this setting as specified by CullingKit::GetDefault().

Returns
A reference to this object.

◆ UnsetVolume()

CullingControl& HPS::CullingControl::UnsetVolume ( )

Removes the volume culling setting. If the control is attached to a WindowKey this function restores the default value of this setting as specified by CullingKit::GetDefault().

Returns
A reference to this object.

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