Panda3D

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

Represents a single vertex in the vertex palette. More...

`#include "fltVertex.h"`

Inheritance diagram for FltVertex:

## Public Types
enum | Flags { F_hard_edge = 0x8000 , F_normal_frozen = 0x4000 , F_no_color = 0x2000 , F_packed_color = 0x1000 }

## Public Member Functions
| FltVertex (FltHeader *header)
virtual TypeHandle | force_init_type ()
LColor | get_color () const
| If has_color() indicates true, returns the color of the vertex, as a four- component value.
FltOpcode | get_opcode () const
| Returns the opcode that this record will be written as.
int | get_record_length () const
| Returns the length of this record in bytes as it will be written to the flt file.
LRGBColor | get_rgb () const
| If has_color() indicates true, returns the color of the vertex, as a three- component value.
virtual TypeHandle | get_type () const
bool | has_color () const
| Returns true if the vertex has a primary color indicated, false otherwise.
void | set_color (const LColor &color)
| Sets the color of the vertex, using the packed color convention.
void | set_rgb (const LRGBColor &rgb)
| Sets the color of the vertex, using the packed color convention.
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.
FltRecord * | get_ancillary (int n) const
| Returns the nth unsupported ancillary record of this record.
FltRecord * | get_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.
FltRecord * | get_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.
FltRecord * | get_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.
virtual void | output (std::ostream &out) const
| Writes a quick one-line description of the record, but not its children.
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
TypedObject * | as_typed_object ()
| Returns the object, upcast (if necessary) to a TypedObject pointer.
const TypedObject * | as_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.
TypedObject & | operator= (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
WeakReferenceList * | get_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.
WeakReferenceList * | weak_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 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 | _color_index
int | _color_name_index
unsigned int | _flags
bool | _has_normal
bool | _has_uv
LPoint3 | _normal
FltPackedColor | _packed_color
LPoint3d | _pos
LPoint2 | _uv
Public Attributes inherited from TypedObject
| get_type
Public Attributes inherited from ReferenceCount
| get_ref_count
| Returns the current reference count.

## Friends
class | FltHeader

## Detailed Description

Represents a single vertex in the vertex palette.

Flt files index vertices by their byte offset in the vertex palette; within this library, we map those byte offsets to pointers automatically.

This may represent a vertex with or without a normal or texture coordinates.

Definition at line 32 of file fltVertex.h.

## Member Enumeration Documentation

## ◆ Flags

enum FltVertex::Flags

Definition at line 39 of file fltVertex.h.

## Constructor & Destructor Documentation

## ◆ FltVertex()

FltVertex::FltVertex | ( | FltHeader * | header | ) |

Definition at line 24 of file fltVertex.cxx.

## Member Function Documentation

## ◆ force_init_type()

virtual TypeHandle FltVertex::force_init_type | ( |  | ) |
| inline virtual

Reimplemented from FltRecord.

Definition at line 73 of file fltVertex.h.

## ◆ get_class_type()

static TypeHandle FltVertex::get_class_type | ( |  | ) |
| inline static

Definition at line 74 of file fltVertex.h.

## ◆ get_color()

LColor FltVertex::get_color | ( |  | ) | const

If has_color() indicates true, returns the color of the vertex, as a four- component value.

In the case of a vertex, the alpha channel will always be 1.0, as MultiGen does not store transparency per-vertex.

Definition at line 110 of file fltVertex.cxx.

References has_color().

Referenced by FltLocalVertexPool::build_record().

## ◆ get_opcode()

FltOpcode FltVertex::get_opcode | ( |  | ) | const

Returns the opcode that this record will be written as.

Definition at line 40 of file fltVertex.cxx.

Referenced by get_record_length().

## ◆ get_record_length()

int FltVertex::get_record_length | ( |  | ) | const

Returns the length of this record in bytes as it will be written to the flt file.

Definition at line 61 of file fltVertex.cxx.

References get_opcode().

## ◆ get_rgb()

LRGBColor FltVertex::get_rgb | ( |  | ) | const

If has_color() indicates true, returns the color of the vertex, as a three- component value.

Definition at line 122 of file fltVertex.cxx.

References has_color().

## ◆ get_type()

virtual TypeHandle FltVertex::get_type | ( |  | ) | const
| inline virtual

Reimplemented from FltRecord.

Definition at line 70 of file fltVertex.h.

## ◆ has_color()

bool FltVertex::has_color | ( |  | ) | const
| inline

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

Definition at line 17 of file fltVertex.I.

Referenced by FltLocalVertexPool::build_record(), get_color(), and get_rgb().

## ◆ init_type()

static void FltVertex::init_type | ( |  | ) |
| inline static

Definition at line 77 of file fltVertex.h.

## ◆ set_color()

void FltVertex::set_color | ( | const LColor & | color | ) |
| inline

Sets the color of the vertex, using the packed color convention.

The alpha component is ignored.

Definition at line 29 of file fltVertex.I.

References set_rgb().

## ◆ set_rgb()

void FltVertex::set_rgb | ( | const LRGBColor & | rgb | ) |

Sets the color of the vertex, using the packed color convention.

Definition at line 133 of file fltVertex.cxx.

Referenced by set_color().

## Friends And Related Symbol Documentation

## ◆ FltHeader

friend class FltHeader
| friend

Definition at line 86 of file fltVertex.h.

## Member Data Documentation

## ◆ _color_index

int FltVertex::_color_index

Definition at line 52 of file fltVertex.h.

## ◆ _color_name_index

int FltVertex::_color_name_index

Definition at line 46 of file fltVertex.h.

## ◆ _flags

unsigned int FltVertex::_flags

Definition at line 47 of file fltVertex.h.

## ◆ _has_normal

bool FltVertex::_has_normal

Definition at line 54 of file fltVertex.h.

## ◆ _has_uv

bool FltVertex::_has_uv

Definition at line 55 of file fltVertex.h.

## ◆ _normal

LPoint3 FltVertex::_normal

Definition at line 49 of file fltVertex.h.

## ◆ _packed_color

FltPackedColor FltVertex::_packed_color

Definition at line 51 of file fltVertex.h.

## ◆ _pos

LPoint3d FltVertex::_pos

Definition at line 48 of file fltVertex.h.

## ◆ _uv

LPoint2 FltVertex::_uv

Definition at line 50 of file fltVertex.h.

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

- pandatool/src/flt/fltVertex.h
- pandatool/src/flt/fltVertex.cxx
- pandatool/src/flt/fltVertex.I