gramods
Public Member Functions | Public Attributes | List of all members
gramods::gmGraphics::Node::NearFarVisitor Struct Reference

Visitor that extracts the optimal near and far planes for a scenegraph. More...

#include <Node.hh>

Inheritance diagram for gramods::gmGraphics::Node::NearFarVisitor:
Inheritance graph
[legend]
Collaboration diagram for gramods::gmGraphics::Node::NearFarVisitor:
Collaboration graph
[legend]

Public Member Functions

 NearFarVisitor (Camera camera)
 
void apply (gmCore::Object *node) override
 This method is called for each visited objects. More...
 
std::optional< std::pair< float, float > > getNearFar () const
 Makes positive, expands with epsilon and returns near and far values, iff the near and far values are reasonable. More...
 
- Public Member Functions inherited from gramods::gmGraphics::Node::TransformStackVisitor
void apply (Object *node, const Eigen::Affine3f &transform)
 

Public Attributes

const Camera camera
 
float near = std::numeric_limits<float>::max()
 
float far = std::numeric_limits<float>::min()
 
- Public Attributes inherited from gramods::gmGraphics::Node::TransformStackVisitor
std::vector< Eigen::Affine3f > stack {Eigen::Affine3f::Identity()}
 

Detailed Description

Visitor that extracts the optimal near and far planes for a scenegraph.

Example usage:

Node::NearFarVisitor nfv(camera);
node->accept(&nfv);
auto near_far = nfv.getNearFar();

Member Function Documentation

◆ apply()

void gramods::gmGraphics::Node::NearFarVisitor::apply ( gmCore::Object node)
overridevirtual

This method is called for each visited objects.

Reimplemented from gramods::gmGraphics::Node::TransformStackVisitor.

◆ getNearFar()

std::optional< std::pair< float, float > > gramods::gmGraphics::Node::NearFarVisitor::getNearFar ( ) const

Makes positive, expands with epsilon and returns near and far values, iff the near and far values are reasonable.


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