Panda3D
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
FltGeometry Class Reference

This is a base class for both FltFace and FltMesh, which are two different kinds of geometric primitives that might be encountered in a MultiGen file. More...

#include "fltGeometry.h"

Inheritance diagram for FltGeometry:
FltBeadID FltBead FltRecord TypedReferenceCount TypedObject ReferenceCount MemoryBase MemoryBase FltFace FltMesh

Public Types

enum  BillboardType { BT_none = 0 , BT_fixed = 1 , BT_axial = 2 , BT_point = 4 }
 
enum  DrawType {
  DT_solid_cull_backface = 0 , DT_solid_no_cull = 1 , DT_wireframe = 2 , DT_wireframe_close = 3 ,
  DT_wireframe_highlight = 4 , DT_omni_light = 8 , DT_uni_light = 9 , DT_bi_light = 10
}
 
enum  Flags {
  F_terrain = 0x80000000 , F_no_color = 0x40000000 , F_no_alt_color = 0x20000000 , F_packed_color = 0x10000000 ,
  F_terrain_footprint = 0x08000000 , F_hidden = 0x04000000
}
 
enum  LightMode { LM_face_no_normal = 0 , LM_vertex_no_normal = 1 , LM_face_with_normal = 2 , LM_vertex_with_normal = 3 }
 

Public Member Functions

 FltGeometry (FltHeader *header)
 
virtual TypeHandle force_init_type ()
 
LColor get_alt_color () const
 If has_alt_color() indicates true, returns the alternate color of the face, as a four-component value (including alpha as the transparency channel).
 
LRGBColor get_alt_rgb () const
 If has_alt_color() indicates true, returns the alternate color of the face, as a three-component value ignoring transparency.
 
LColor get_color () const
 Returns the primary color of the face, as a four-component value (including alpha as the transparency channel).
 
FltMaterialget_material () const
 Returns the material applied to this face, or NULL if no material was applied.
 
LRGBColor get_rgb () const
 Returns the primary color of the face, as a three-component value ignoring transparency.
 
FltTextureget_texture () const
 Returns the texture applied to this face, or NULL if no texture was applied.
 
virtual TypeHandle get_type () const
 
bool has_alt_color () const
 Returns true if the face has an alternate color indicated, false otherwise.
 
bool has_color () const
 Returns true if the face has a primary color indicated, false otherwise.
 
bool has_material () const
 Returns true if the face has a material applied, false otherwise.
 
bool has_texture () const
 Returns true if the face has a texture applied, false otherwise.
 
void set_color (const LColor &color)
 Sets the primary color of the face, using the packed color convention.
 
void set_material (FltMaterial *material)
 Applies the indicated material to this face, or if the material is NULL, clears it.
 
void set_rgb (const LRGBColor &rgb)
 Sets the primary color of the face, using the packed color convention; does not affect transparency.
 
void set_texture (FltTexture *texture)
 Applies the indicated texture to this face, or if the texture is NULL, clears it.
 
- Public Member Functions inherited from FltBeadID
 FltBeadID (FltHeader *header)
 
const std::string & get_id () const
 Returns the id (name) of this particular bead.
 
virtual void output (std::ostream &out) const
 Writes a quick one-line description of the record, but not its children.
 
void set_id (const std::string &id)
 Changes the id (name) of this particular bead.
 
- Public Member Functions inherited from FltBead
 FltBead (FltHeader *header)
 
void add_transform_step (FltTransformRecord *record)
 Applies the indicated transform step to the net transformation applied to the bead.
 
void clear_transform ()
 Removes any transform matrix and all transform steps on this bead.
 
int get_num_transform_steps () const
 Returns the number of individual steps that define the net transform on this bead as returned by set_transform().
 
int get_replicate_count () const
 Returns the replicate count of this bead.
 
const LMatrix4d & get_transform () const
 Returns the single-precision 4x4 matrix that represents the transform applied to this bead, or the identity matrix if the bead has not been transformed.
 
FltTransformRecordget_transform_step (int n)
 Returns the nth individual step that defines the net transform on this bead.
 
const FltTransformRecordget_transform_step (int n) const
 Returns the nth individual step that defines the net transform on this bead.
 
bool has_transform () const
 Returns true if the bead has been transformed, false otherwise.
 
void set_replicate_count (int count)
 Changes the replicate count of this bead.
 
void set_transform (const LMatrix4d &mat)
 Replaces the transform matrix on this bead.
 
- Public Member Functions inherited from FltRecord
 FltRecord (FltHeader *header)
 
void add_ancillary (FltRecord *ancillary)
 Adds a new unsupported ancillary record to the end of the list of ancillary records for this record.
 
void add_child (FltRecord *child)
 Adds a new child to the end of the list of children for this record.
 
void add_extension (FltRecord *extension)
 Adds a new extension to the end of the list of extensions for this record.
 
void add_subface (FltRecord *subface)
 Adds a new subface to the end of the list of subfaces for this record.
 
virtual void apply_converted_filenames ()
 Walks the hierarchy at this record and below and copies the _converted_filename record into the _orig_filename record, so the flt file will be written out with the converted filename instead of what was originally read in.
 
void check_remaining_size (const DatagramIterator &di, const std::string &name=std::string()) const
 Checks that the iterator has no bytes left, as it should at the end of a successfully read record.
 
void clear_ancillary ()
 Removes all unsupported ancillary records from this record.
 
void clear_children ()
 Removes all children from this record.
 
void clear_comment ()
 Removes the comment for this record.
 
void clear_extensions ()
 Removes all extensions from this record.
 
void clear_subfaces ()
 Removes all subfaces from this record.
 
FltRecordget_ancillary (int n) const
 Returns the nth unsupported ancillary record of this record.
 
FltRecordget_child (int n) const
 Returns the nth child of this record.
 
const std::string & get_comment () const
 Retrieves the comment for this record, or empty string if the record has no comment.
 
FltRecordget_extension (int n) const
 Returns the nth extension of this record.
 
int get_num_ancillary () const
 Returns the number of unsupported ancillary records of this record.
 
int get_num_children () const
 Returns the number of child records of this record.
 
int get_num_extensions () const
 Returns the number of extension attribute records for this object.
 
int get_num_subfaces () const
 Returns the number of subface records of this record.
 
FltRecordget_subface (int n) const
 Returns the nth subface of this record.
 
bool has_comment () const
 Returns true if this record has a nonempty comment, false otherwise.
 
void set_comment (const std::string &comment)
 Changes the comment for this record.
 
virtual void write (std::ostream &out, int indent_level=0) const
 Writes a multiple-line description of the record and all of its children.
 
- Public Member Functions inherited from TypedReferenceCount
 TypedReferenceCount (const TypedReferenceCount &copy)
 
void operator= (const TypedReferenceCount &copy)
 
- Public Member Functions inherited from TypedObject
 TypedObject (const TypedObject &copy)=default
 
TypedObjectas_typed_object ()
 Returns the object, upcast (if necessary) to a TypedObject pointer.
 
const TypedObjectas_typed_object () const
 Returns the object, upcast (if necessary) to a TypedObject pointer.
 
int get_best_parent_from_Set (const std::set< int > &) const
 
int get_type_index () const
 Returns the internal index number associated with this object's TypeHandle, a unique number for each different type.
 
bool is_exact_type (TypeHandle handle) const
 Returns true if the current object is the indicated type exactly.
 
bool is_of_type (TypeHandle handle) const
 Returns true if the current object is or derives from the indicated type.
 
TypedObjectoperator= (const TypedObject &copy)=default
 
- Public Member Functions inherited from MemoryBase
void operator delete (void *, void *)
 
void operator delete (void *ptr)
 
void operator delete[] (void *, void *)
 
void operator delete[] (void *ptr)
 
void * operator new (size_t size)
 
void * operator new (size_t size, void *ptr)
 
void * operator new[] (size_t size)
 
void * operator new[] (size_t size, void *ptr)
 
- Public Member Functions inherited from ReferenceCount
int get_ref_count () const
 
WeakReferenceListget_weak_list () const
 Returns the WeakReferenceList associated with this ReferenceCount object.
 
bool has_weak_list () const
 Returns true if this particular ReferenceCount object has a WeakReferenceList created, false otherwise.
 
void local_object ()
 This function should be called, once, immediately after creating a new instance of some ReferenceCount-derived object on the stack.
 
void ref () const
 Explicitly increments the reference count.
 
bool ref_if_nonzero () const
 Atomically increases the reference count of this object if it is not zero.
 
bool test_ref_count_integrity () const
 Does some easy checks to make sure that the reference count isn't completely bogus.
 
bool test_ref_count_nonzero () const
 Does some easy checks to make sure that the reference count isn't zero, or completely bogus.
 
virtual bool unref () const
 Explicitly decrements the reference count.
 
bool unref_if_one () const
 Atomically decreases the reference count of this object if it is one.
 
WeakReferenceListweak_ref ()
 Adds the indicated PointerToVoid as a weak reference to this object.
 
void weak_unref ()
 Removes the indicated PointerToVoid as a weak reference to this object.
 

Static Public Member Functions

static TypeHandle get_class_type ()
 
static void init_type ()
 
- Static Public Member Functions inherited from FltBeadID
static TypeHandle get_class_type ()
 
static void init_type ()
 
- Static Public Member Functions inherited from FltBead
static TypeHandle get_class_type ()
 
static void init_type ()
 
- Static Public Member Functions inherited from FltRecord
static TypeHandle get_class_type ()
 
static void init_type ()
 
- Static Public Member Functions inherited from TypedReferenceCount
static TypeHandle get_class_type ()
 
static void init_type ()
 
- Static Public Member Functions inherited from TypedObject
static TypeHandle get_class_type ()
 
static void init_type ()
 This function is declared non-inline to work around a compiler bug in g++ 2.96.
 
- Static Public Member Functions inherited from ReferenceCount
static TypeHandle get_class_type ()
 
static void init_type ()
 

Public Attributes

int _alt_color_index
 
int _alt_color_name_index
 
FltPackedColor _alt_packed_color
 
BillboardType _billboard_type
 
int _color_index
 
int _color_name_index
 
int _detail_texture_index
 
int _dfad_feature_id
 
int _dfad_material_code
 
DrawType _draw_type
 
unsigned int _flags
 
int _ir_color
 
int _ir_material_code
 
LightMode _light_mode
 
int _line_style_index
 
int _lod_generation_control
 
int _material_index
 
FltPackedColor _packed_color
 
int _relative_priority
 
int _texture_index
 
int _texture_mapping_index
 
bool _texwhite
 
int _transparency
 
- Public Attributes inherited from TypedObject
 get_type
 
- Public Attributes inherited from ReferenceCount
 get_ref_count
 Returns the current reference count.
 

Detailed Description

This is a base class for both FltFace and FltMesh, which are two different kinds of geometric primitives that might be encountered in a MultiGen file.

They have similar properties.

Definition at line 33 of file fltGeometry.h.

Member Enumeration Documentation

◆ BillboardType

enum FltGeometry::BillboardType

Definition at line 48 of file fltGeometry.h.

◆ DrawType

enum FltGeometry::DrawType

Definition at line 37 of file fltGeometry.h.

◆ Flags

enum FltGeometry::Flags

Definition at line 55 of file fltGeometry.h.

◆ LightMode

enum FltGeometry::LightMode

Definition at line 64 of file fltGeometry.h.

Constructor & Destructor Documentation

◆ FltGeometry()

FltGeometry::FltGeometry ( FltHeader * header)

Definition at line 25 of file fltGeometry.cxx.

Member Function Documentation

◆ force_init_type()

virtual TypeHandle FltGeometry::force_init_type ( )
inlinevirtual

Reimplemented from FltBeadID.

Definition at line 123 of file fltGeometry.h.

◆ get_alt_color()

LColor FltGeometry::get_alt_color ( ) const

If has_alt_color() indicates true, returns the alternate color of the face, as a four-component value (including alpha as the transparency channel).

Definition at line 143 of file fltGeometry.cxx.

References has_alt_color().

◆ get_alt_rgb()

LRGBColor FltGeometry::get_alt_rgb ( ) const

If has_alt_color() indicates true, returns the alternate color of the face, as a three-component value ignoring transparency.

Definition at line 155 of file fltGeometry.cxx.

References has_alt_color().

◆ get_class_type()

static TypeHandle FltGeometry::get_class_type ( )
inlinestatic

Definition at line 124 of file fltGeometry.h.

◆ get_color()

LColor FltGeometry::get_color ( ) const

Returns the primary color of the face, as a four-component value (including alpha as the transparency channel).

If has_color() is false, the result is white, but still reflects the transparency correctly.

Definition at line 58 of file fltGeometry.cxx.

References get_material(), has_color(), has_material(), and has_texture().

◆ get_material()

FltMaterial * FltGeometry::get_material ( ) const
inline

Returns the material applied to this face, or NULL if no material was applied.

Definition at line 57 of file fltGeometry.I.

Referenced by get_color(), and get_rgb().

◆ get_rgb()

LRGBColor FltGeometry::get_rgb ( ) const

Returns the primary color of the face, as a three-component value ignoring transparency.

Definition at line 100 of file fltGeometry.cxx.

References get_material(), has_color(), has_material(), and has_texture().

◆ get_texture()

FltTexture * FltGeometry::get_texture ( ) const
inline

Returns the texture applied to this face, or NULL if no texture was applied.

Definition at line 26 of file fltGeometry.I.

◆ get_type()

virtual TypeHandle FltGeometry::get_type ( ) const
inlinevirtual

Reimplemented from FltBeadID.

Definition at line 120 of file fltGeometry.h.

◆ has_alt_color()

bool FltGeometry::has_alt_color ( ) const

Returns true if the face has an alternate color indicated, false otherwise.

Definition at line 134 of file fltGeometry.cxx.

Referenced by get_alt_color(), and get_alt_rgb().

◆ has_color()

bool FltGeometry::has_color ( ) const
inline

Returns true if the face has a primary color indicated, false otherwise.

Definition at line 79 of file fltGeometry.I.

References has_material().

Referenced by get_color(), and get_rgb().

◆ has_material()

bool FltGeometry::has_material ( ) const
inline

Returns true if the face has a material applied, false otherwise.

Definition at line 48 of file fltGeometry.I.

Referenced by get_color(), get_rgb(), and has_color().

◆ has_texture()

bool FltGeometry::has_texture ( ) const
inline

Returns true if the face has a texture applied, false otherwise.

Definition at line 17 of file fltGeometry.I.

Referenced by get_color(), and get_rgb().

◆ init_type()

static void FltGeometry::init_type ( )
inlinestatic

Definition at line 127 of file fltGeometry.h.

◆ set_color()

void FltGeometry::set_color ( const LColor & color)

Sets the primary color of the face, using the packed color convention.

Definition at line 90 of file fltGeometry.cxx.

References set_rgb().

◆ set_material()

void FltGeometry::set_material ( FltMaterial * material)
inline

Applies the indicated material to this face, or if the material is NULL, clears it.

Definition at line 66 of file fltGeometry.I.

◆ set_rgb()

void FltGeometry::set_rgb ( const LRGBColor & rgb)

Sets the primary color of the face, using the packed color convention; does not affect transparency.

Definition at line 121 of file fltGeometry.cxx.

References FltPackedColor::set_rgb().

Referenced by set_color().

◆ set_texture()

void FltGeometry::set_texture ( FltTexture * texture)
inline

Applies the indicated texture to this face, or if the texture is NULL, clears it.

Definition at line 35 of file fltGeometry.I.

Member Data Documentation

◆ _alt_color_index

int FltGeometry::_alt_color_index

Definition at line 93 of file fltGeometry.h.

◆ _alt_color_name_index

int FltGeometry::_alt_color_name_index

Definition at line 76 of file fltGeometry.h.

◆ _alt_packed_color

FltPackedColor FltGeometry::_alt_packed_color

Definition at line 90 of file fltGeometry.h.

◆ _billboard_type

BillboardType FltGeometry::_billboard_type

Definition at line 77 of file fltGeometry.h.

◆ _color_index

int FltGeometry::_color_index

Definition at line 92 of file fltGeometry.h.

◆ _color_name_index

int FltGeometry::_color_name_index

Definition at line 75 of file fltGeometry.h.

◆ _detail_texture_index

int FltGeometry::_detail_texture_index

Definition at line 78 of file fltGeometry.h.

◆ _dfad_feature_id

int FltGeometry::_dfad_feature_id

Definition at line 82 of file fltGeometry.h.

◆ _dfad_material_code

int FltGeometry::_dfad_material_code

Definition at line 81 of file fltGeometry.h.

◆ _draw_type

DrawType FltGeometry::_draw_type

Definition at line 73 of file fltGeometry.h.

◆ _flags

unsigned int FltGeometry::_flags

Definition at line 87 of file fltGeometry.h.

◆ _ir_color

int FltGeometry::_ir_color

Definition at line 71 of file fltGeometry.h.

◆ _ir_material_code

int FltGeometry::_ir_material_code

Definition at line 83 of file fltGeometry.h.

◆ _light_mode

LightMode FltGeometry::_light_mode

Definition at line 88 of file fltGeometry.h.

◆ _line_style_index

int FltGeometry::_line_style_index

Definition at line 86 of file fltGeometry.h.

◆ _lod_generation_control

int FltGeometry::_lod_generation_control

Definition at line 85 of file fltGeometry.h.

◆ _material_index

int FltGeometry::_material_index

Definition at line 80 of file fltGeometry.h.

◆ _packed_color

FltPackedColor FltGeometry::_packed_color

Definition at line 89 of file fltGeometry.h.

◆ _relative_priority

int FltGeometry::_relative_priority

Definition at line 72 of file fltGeometry.h.

◆ _texture_index

int FltGeometry::_texture_index

Definition at line 79 of file fltGeometry.h.

◆ _texture_mapping_index

int FltGeometry::_texture_mapping_index

Definition at line 91 of file fltGeometry.h.

◆ _texwhite

bool FltGeometry::_texwhite

Definition at line 74 of file fltGeometry.h.

◆ _transparency

int FltGeometry::_transparency

Definition at line 84 of file fltGeometry.h.


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