Panda3D

Loading...
Searching...
No Matches
Public Types | Public Member Functions | List of all members
SceneGraphAnalyzer Class Reference

A handy class that can scrub over a scene graph and collect interesting statistics on it. More...

`#include "sceneGraphAnalyzer.h"`

## Public Types
enum | LodMode { LM_lowest , LM_highest , LM_all , LM_none }

## Public Member Functions
void | add_node (PandaNode *node)
| Adds a new node to the set of data for analysis.
void | clear ()
| Resets all of the data in the analyzer in preparation for a new run.
LodMode | get_lod_mode (LodMode lod_mode) const
| Returns the mode in which LODNodes are analyzed.
int | get_num_colors () const
int | get_num_geom_nodes () const
int | get_num_geom_vertex_datas () const
int | get_num_geom_vertex_formats () const
int | get_num_geoms () const
int | get_num_individual_tris () const
int | get_num_instances () const
int | get_num_lines () const
int | get_num_lod_nodes () const
int | get_num_long_normals () const
int | get_num_nodes () const
int | get_num_nodes_with_attribs () const
int | get_num_normals () const
int | get_num_patches () const
int | get_num_points () const
int | get_num_short_normals () const
int | get_num_texcoords () const
int | get_num_transforms () const
int | get_num_triangles_in_fans () const
int | get_num_triangles_in_strips () const
int | get_num_trifans () const
int | get_num_tris () const
int | get_num_tristrips () const
int | get_num_vertices () const
int | get_num_vertices_in_patches () const
size_t | get_texture_bytes () const
PN_stdfloat | get_total_normal_length () const
size_t | get_vertex_data_size () const
void | set_lod_mode (LodMode lod_mode)
| Specifies the mode in which LODNodes are analyzed.
void | write (std::ostream &out, int indent_level=0) const
| Describes all the data collected.

## Detailed Description

A handy class that can scrub over a scene graph and collect interesting statistics on it.

Definition at line 37 of file sceneGraphAnalyzer.h.

## Member Enumeration Documentation

## ◆ LodMode

enum SceneGraphAnalyzer::LodMode

Definition at line 42 of file sceneGraphAnalyzer.h.

## Constructor & Destructor Documentation

## ◆ SceneGraphAnalyzer()

SceneGraphAnalyzer::SceneGraphAnalyzer | ( |  | ) |

Definition at line 38 of file sceneGraphAnalyzer.cxx.

## ◆ ~SceneGraphAnalyzer()

SceneGraphAnalyzer::~SceneGraphAnalyzer | ( |  | ) |

Definition at line 47 of file sceneGraphAnalyzer.cxx.

## Member Function Documentation

## ◆ add_node()

void SceneGraphAnalyzer::add_node | ( | PandaNode * | node | ) |

Adds a new node to the set of data for analysis.

Normally, this would only be called once, and passed the top of the scene graph, but it's possible to repeatedly pass in subgraphs to get an analysis of all the graphs together.

Definition at line 105 of file sceneGraphAnalyzer.cxx.

Referenced by PandaFramework::event_A().

## ◆ clear()

void SceneGraphAnalyzer::clear | ( |  | ) |

Resets all of the data in the analyzer in preparation for a new run.

Definition at line 54 of file sceneGraphAnalyzer.cxx.

## ◆ get_lod_mode()

SceneGraphAnalyzer::LodMode SceneGraphAnalyzer::get_lod_mode | ( | LodMode | lod_mode | ) | const
| inline

Returns the mode in which LODNodes are analyzed.

Definition at line 25 of file sceneGraphAnalyzer.I.

## ◆ get_num_colors()

int SceneGraphAnalyzer::get_num_colors | ( |  | ) | const
| inline

Definition at line 129 of file sceneGraphAnalyzer.I.

## ◆ get_num_geom_nodes()

int SceneGraphAnalyzer::get_num_geom_nodes | ( |  | ) | const
| inline

Definition at line 73 of file sceneGraphAnalyzer.I.

## ◆ get_num_geom_vertex_datas()

int SceneGraphAnalyzer::get_num_geom_vertex_datas | ( |  | ) | const
| inline

Definition at line 89 of file sceneGraphAnalyzer.I.

## ◆ get_num_geom_vertex_formats()

int SceneGraphAnalyzer::get_num_geom_vertex_formats | ( |  | ) | const
| inline

Definition at line 97 of file sceneGraphAnalyzer.I.

## ◆ get_num_geoms()

int SceneGraphAnalyzer::get_num_geoms | ( |  | ) | const
| inline

Definition at line 81 of file sceneGraphAnalyzer.I.

## ◆ get_num_individual_tris()

int SceneGraphAnalyzer::get_num_individual_tris | ( |  | ) | const
| inline

Definition at line 178 of file sceneGraphAnalyzer.I.

## ◆ get_num_instances()

int SceneGraphAnalyzer::get_num_instances | ( |  | ) | const
| inline

Definition at line 41 of file sceneGraphAnalyzer.I.

## ◆ get_num_lines()

int SceneGraphAnalyzer::get_num_lines | ( |  | ) | const
| inline

Definition at line 153 of file sceneGraphAnalyzer.I.

## ◆ get_num_lod_nodes()

int SceneGraphAnalyzer::get_num_lod_nodes | ( |  | ) | const
| inline

Definition at line 65 of file sceneGraphAnalyzer.I.

## ◆ get_num_long_normals()

int SceneGraphAnalyzer::get_num_long_normals | ( |  | ) | const
| inline

Definition at line 236 of file sceneGraphAnalyzer.I.

## ◆ get_num_nodes()

int SceneGraphAnalyzer::get_num_nodes | ( |  | ) | const
| inline

Definition at line 33 of file sceneGraphAnalyzer.I.

## ◆ get_num_nodes_with_attribs()

int SceneGraphAnalyzer::get_num_nodes_with_attribs | ( |  | ) | const
| inline

Definition at line 57 of file sceneGraphAnalyzer.I.

## ◆ get_num_normals()

int SceneGraphAnalyzer::get_num_normals | ( |  | ) | const
| inline

Definition at line 121 of file sceneGraphAnalyzer.I.

## ◆ get_num_patches()

int SceneGraphAnalyzer::get_num_patches | ( |  | ) | const
| inline

Definition at line 169 of file sceneGraphAnalyzer.I.

## ◆ get_num_points()

int SceneGraphAnalyzer::get_num_points | ( |  | ) | const
| inline

Definition at line 161 of file sceneGraphAnalyzer.I.

## ◆ get_num_short_normals()

int SceneGraphAnalyzer::get_num_short_normals | ( |  | ) | const
| inline

Definition at line 244 of file sceneGraphAnalyzer.I.

## ◆ get_num_texcoords()

int SceneGraphAnalyzer::get_num_texcoords | ( |  | ) | const
| inline

Definition at line 137 of file sceneGraphAnalyzer.I.

## ◆ get_num_transforms()

int SceneGraphAnalyzer::get_num_transforms | ( |  | ) | const
| inline

Definition at line 49 of file sceneGraphAnalyzer.I.

## ◆ get_num_triangles_in_fans()

int SceneGraphAnalyzer::get_num_triangles_in_fans | ( |  | ) | const
| inline

Definition at line 210 of file sceneGraphAnalyzer.I.

## ◆ get_num_triangles_in_strips()

int SceneGraphAnalyzer::get_num_triangles_in_strips | ( |  | ) | const
| inline

Definition at line 194 of file sceneGraphAnalyzer.I.

## ◆ get_num_trifans()

int SceneGraphAnalyzer::get_num_trifans | ( |  | ) | const
| inline

Definition at line 202 of file sceneGraphAnalyzer.I.

## ◆ get_num_tris()

int SceneGraphAnalyzer::get_num_tris | ( |  | ) | const
| inline

Definition at line 145 of file sceneGraphAnalyzer.I.

## ◆ get_num_tristrips()

int SceneGraphAnalyzer::get_num_tristrips | ( |  | ) | const
| inline

Definition at line 186 of file sceneGraphAnalyzer.I.

## ◆ get_num_vertices()

int SceneGraphAnalyzer::get_num_vertices | ( |  | ) | const
| inline

Definition at line 113 of file sceneGraphAnalyzer.I.

## ◆ get_num_vertices_in_patches()

int SceneGraphAnalyzer::get_num_vertices_in_patches | ( |  | ) | const
| inline

Definition at line 218 of file sceneGraphAnalyzer.I.

## ◆ get_texture_bytes()

size_t SceneGraphAnalyzer::get_texture_bytes | ( |  | ) | const
| inline

Definition at line 227 of file sceneGraphAnalyzer.I.

## ◆ get_total_normal_length()

PN_stdfloat SceneGraphAnalyzer::get_total_normal_length | ( |  | ) | const
| inline

Definition at line 252 of file sceneGraphAnalyzer.I.

## ◆ get_vertex_data_size()

size_t SceneGraphAnalyzer::get_vertex_data_size | ( |  | ) | const
| inline

Definition at line 105 of file sceneGraphAnalyzer.I.

## ◆ set_lod_mode()

void SceneGraphAnalyzer::set_lod_mode | ( | LodMode | lod_mode | ) |
| inline

Specifies the mode in which LODNodes are analyzed.

Definition at line 17 of file sceneGraphAnalyzer.I.

## ◆ write()

void SceneGraphAnalyzer::write | ( | std::ostream & | out,
|  | int | indent_level = 0 ) const

Describes all the data collected.

Definition at line 113 of file sceneGraphAnalyzer.cxx.

References GeomVertexArrayData::get_data_size_bytes, BitArray::get_num_on_bits(), and indent().

Referenced by PandaFramework::event_A().

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

- panda/src/pgraphnodes/sceneGraphAnalyzer.h
- panda/src/pgraphnodes/sceneGraphAnalyzer.cxx
- panda/src/pgraphnodes/sceneGraphAnalyzer.I