Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members  

CardMaker Class Reference

This class generates 2-d "cards", that is, rectangular polygons, particularly useful for showing textures etc. More...

#include <cardMaker.h>

Inheritance diagram for CardMaker:

Namable List of all members.

Public Member Functions

 CardMaker (const string &name)
 ~CardMaker ()
void reset ()
 Resets all the parameters to their initial defaults.

void set_uv_range (const TexCoordf &ll, const TexCoordf &ur)
 Sets the range of UV's that will be applied to the vertices.

void set_has_uvs (bool flag)
 Sets the flag indicating whether vertices will be generated with UV's or not.

void set_frame (float left, float right, float bottom, float top)
 Sets the size of the card.

void set_frame (const LVecBase4f &frame)
 Sets the size of the card.

void set_color (float r, float g, float b, float a)
 Sets the color of the card.

void set_color (const Colorf &color)
void set_source_geometry (PandaNode *node, const LVecBase4f &frame)
 Sets a node that will be copied (and scaled and translated) to generate the frame, instead of generating a new polygon.

void clear_source_geometry ()
 Removes the node specified by an earlier call to set_source_geometry().

PointerTo< PandaNodegenerate ()
 Generates a GeomNode that renders the specified geometry.

void set_name (const string &name)
void clear_name ()
 Resets the Namable's name to empty.

bool has_name () const
 Returns true if the Namable has a nonempty name set, false if the name is empty.

const string & get_name () const
void output (ostream &out) const
 Outputs the Namable.


Static Public Member Functions

TypeHandle get_class_type ()
void init_type ()

Private Member Functions

PointerTo< PandaNoderescale_source_geometry ()
 Generates the card by rescaling the source geometry appropriately.


Private Attributes

bool _has_uvs
TexCoordf _ll
TexCoordf _ur
LVecBase4f _frame
bool _has_color
Colorf _color
PointerTo< PandaNode_source_geometry
LVecBase4f _source_frame

Detailed Description

This class generates 2-d "cards", that is, rectangular polygons, particularly useful for showing textures etc.

in the 2-d scene graph.

Definition at line 43 of file cardMaker.h.


Constructor & Destructor Documentation

CardMaker::CardMaker const string &  name  )  [inline]
 

Definition at line 31 of file cardMaker.I.

References INLINE.

CardMaker::~CardMaker  )  [inline]
 

Definition at line 43 of file cardMaker.I.

References _ll, _ur, and INLINE.


Member Function Documentation

void Namable::clear_name  )  [inline, inherited]
 

Resets the Namable's name to empty.

Definition at line 82 of file namable.I.

References Namable::_name, and INLINE.

void CardMaker::clear_source_geometry  )  [inline]
 

Removes the node specified by an earlier call to set_source_geometry().

Definition at line 181 of file cardMaker.I.

PointerTo< PandaNode > CardMaker::generate  ) 
 

Generates a GeomNode that renders the specified geometry.

Definition at line 62 of file cardMaker.cxx.

TypeHandle Namable::get_class_type void   )  [inline, static, inherited]
 

Reimplemented in AnimBundle, AnimBundleNode, AnimChannel< SwitchType >, AnimChannelBase, AnimChannelFixed< SwitchType >, AnimChannelMatrixXfmTable, AnimChannelScalarTable, AnimGroup, MovingPart< SwitchType >, MovingPartBase, MovingPartMatrix, MovingPartScalar, PartBundle, PartBundleNode, PartGroup, Character, CharacterJoint, CharacterJointBundle, CharacterSlider, CollisionNode, AnalogNode, ButtonNode, DialNode, MouseAndKeyboard, TrackerNode, VirtualMouse, DataNode, ProjectionScreen, EggAnimData, EggBin, EggComment, EggCoordinateSystem, EggCurve, EggData, EggExternalReference, EggFilenameNode, EggGroup, EggGroupNode, EggMaterial, EggNamedObject, EggNode, EggNurbsCurve, EggNurbsSurface, EggPoint, EggPolygon, EggPrimitive, EggSAnimData, EggSurface, EggTable, EggTexture, EggVertexPool, EggXfmAnimData, EggXfmSAnim, ImageBuffer, PixelBuffer, Texture, ClassicNurbsCurve, CubicCurveseg, HermiteCurve, NurbsPPCurve, ParametricCurve, PiecewiseCurve, RopeNode, AmbientLight, Camera, DirectionalLight, Fog, GeomNode, LensNode, LightLensNode, LightNode, LODNode, ModelNode, ModelRoot, PandaNode, PlaneNode, PointLight, SelectiveChildNode, SequenceNode, Spotlight, SwitchNode, PGButton, PGEntry, PGItem, PGMouseWatcherBackground, PGMouseWatcherRegion, PGTop, PGWaitBar, ActorNode, ForceNode, PhysicalNode, TextFont, TextNode, ButtonThrower, DriveInterface, MouseWatcher, MouseWatcherRegion, Trackball, Transform2SG, AnimChannel< ACScalarSwitchType >, AnimChannel< ACMatrixSwitchType >, MovingPart< ACScalarSwitchType >, and MovingPart< ACMatrixSwitchType >.

Definition at line 60 of file namable.h.

Referenced by MouseWatcherRegion::init_type().

const string & Namable::get_name  )  const [inline, inherited]
 

Definition at line 109 of file namable.I.

Referenced by ComputedVerticesMaker::add_normal(), GLGraphicsStateGuardian::begin_bind_clip_planes(), GLGraphicsStateGuardian::begin_bind_lights(), BuilderBucket::BuilderBucket(), EggVertex::clear_grefs(), AnimBundleMaker::create_xfm_channel(), SceneGraphReducer::do_flatten_siblings(), BuilderBucket::done_geom(), DXTextureContext8::DXTextureContext8(), PartGroup::find_child(), EggLoader::find_collision_geometry(), EggGroupUniquifier::get_category(), PartBundle::get_control_effect(), PartGroup::get_num_children(), EggMorph< Parameter >::get_offset(), AnimChannelBase::has_changed(), Namable::has_name(), EggMaterial::is_equivalent_to(), Texture::load(), EggLoader::make_node(), AnimBundleMaker::make_node(), FindApproxPath::Component::matches(), LineSegs::move_to(), MovingPartBase::MovingPartBase(), NodeMap::NodeMap(), EggMorph< Parameter >::operator<(), operator<<(), MouseWatcherRegion::output(), AnimGroup::output(), EggXfmSAnim::r_transform(), Texture::read(), MouseWatcherGroup::remove_region(), EggLoader::reparent_decals(), CRGraphicsStateGuardian::set_blend_mode(), NodePath::set_color(), GLGraphicsStateGuardian::set_draw_buffer(), AnimChannelScalarTable::set_table(), NodePath::set_transparency(), NodePathComponent::uncollapse(), Texture::unprepare(), TextNode::wordwrap_to(), MovingPartBase::write(), CollisionNode::xform(), and EggVertex::~EggVertex().

bool Namable::has_name  )  const [inline, inherited]
 

Returns true if the Namable has a nonempty name set, false if the name is empty.

Definition at line 97 of file namable.I.

References Namable::get_name(), and INLINE.

Referenced by EggGroupUniquifier::EggGroupUniquifier(), Texture::read(), and Texture::Texture().

void Namable::init_type void   )  [inline, static, inherited]
 

Reimplemented in AnimBundle, AnimBundleNode, AnimChannel< SwitchType >, AnimChannelBase, AnimChannelFixed< SwitchType >, AnimChannelMatrixXfmTable, AnimChannelScalarTable, AnimGroup, MovingPart< SwitchType >, MovingPartBase, MovingPartMatrix, MovingPartScalar, PartBundle, PartBundleNode, PartGroup, Character, CharacterJoint, CharacterJointBundle, CharacterSlider, CollisionNode, AnalogNode, ButtonNode, DialNode, MouseAndKeyboard, TrackerNode, VirtualMouse, DataNode, ProjectionScreen, EggAnimData, EggBin, EggComment, EggCoordinateSystem, EggCurve, EggData, EggExternalReference, EggFilenameNode, EggGroup, EggGroupNode, EggMaterial, EggNamedObject, EggNode, EggNurbsCurve, EggNurbsSurface, EggPoint, EggPolygon, EggPrimitive, EggSAnimData, EggSurface, EggTable, EggTexture, EggVertexPool, EggXfmAnimData, EggXfmSAnim, ImageBuffer, PixelBuffer, Texture, ClassicNurbsCurve, CubicCurveseg, HermiteCurve, NurbsPPCurve, ParametricCurve, PiecewiseCurve, RopeNode, AmbientLight, Camera, DirectionalLight, Fog, GeomNode, LensNode, LightLensNode, LightNode, LODNode, ModelNode, ModelRoot, PandaNode, PlaneNode, PointLight, SelectiveChildNode, SequenceNode, Spotlight, SwitchNode, PGButton, PGEntry, PGItem, PGMouseWatcherBackground, PGMouseWatcherRegion, PGTop, PGWaitBar, ActorNode, ForceNode, PhysicalNode, TextFont, TextNode, ButtonThrower, DriveInterface, MouseWatcher, MouseWatcherRegion, Trackball, Transform2SG, AnimChannel< ACScalarSwitchType >, AnimChannel< ACMatrixSwitchType >, MovingPart< ACScalarSwitchType >, and MovingPart< ACMatrixSwitchType >.

Definition at line 63 of file namable.h.

References INLINE.

void Namable::output ostream &  out  )  const [inline, inherited]
 

Outputs the Namable.

This function simply writes the name to the output stream; most Namable derivatives will probably redefine this.

Reimplemented in BuilderBucket, AnimBundle, AnimChannelBase, AnimChannelFixed< SwitchType >, AnimGroup, PartBundle, CollisionNode, ButtonNode, HermiteCurve, RopeNode, Fog, GeomNode, LensNode, LightLensNode, LightNode, LODNode, PandaNode, PlaneNode, MouseWatcher, and MouseWatcherRegion.

Definition at line 126 of file namable.I.

PointerTo< PandaNode > CardMaker::rescale_source_geometry  )  [private]
 

Generates the card by rescaling the source geometry appropriately.

Definition at line 117 of file cardMaker.cxx.

References root.

void CardMaker::reset  ) 
 

Resets all the parameters to their initial defaults.

Definition at line 39 of file cardMaker.cxx.

References NULL.

void CardMaker::set_color const Colorf color  )  [inline]
 

void CardMaker::set_color float  r,
float  g,
float  b,
float  a
[inline]
 

Sets the color of the card.

Definition at line 118 of file cardMaker.I.

References _source_frame, _source_geometry, and INLINE.

void CardMaker::set_frame const LVecBase4f &  frame  )  [inline]
 

Sets the size of the card.

Definition at line 105 of file cardMaker.I.

void CardMaker::set_frame float  left,
float  right,
float  bottom,
float  top
[inline]
 

Sets the size of the card.

Definition at line 92 of file cardMaker.I.

void CardMaker::set_has_uvs bool  flag  )  [inline]
 

Sets the flag indicating whether vertices will be generated with UV's or not.

Definition at line 79 of file cardMaker.I.

References _frame, and INLINE.

void Namable::set_name const string &  name  )  [inline, inherited]
 

Definition at line 69 of file namable.I.

References Namable::_name.

Referenced by BuilderBucket::BuilderBucket(), SceneGraphReducer::do_flatten_siblings(), Texture::read(), PandaNode::reparent(), and Texture::Texture().

void CardMaker::set_source_geometry PandaNode node,
const LVecBase4f &  frame
[inline]
 

Sets a node that will be copied (and scaled and translated) to generate the frame, instead of generating a new polygon.

The node may contain arbitrary geometry that describes a flat polygon contained within the indicated left, right, bottom, top frame.

When generate() is called, the geometry in this node will be scaled and translated appropriately to give it the size and aspect ratio specified by set_frame().

Definition at line 165 of file cardMaker.I.

void CardMaker::set_uv_range const TexCoordf ll,
const TexCoordf ur
[inline]
 

Sets the range of UV's that will be applied to the vertices.

If set_has_uvs() is true (as it is by default), the vertices will be generated with the indicated range of UV's, which will be useful if a texture is applied.

Definition at line 63 of file cardMaker.I.


Member Data Documentation

Colorf CardMaker::_color [private]
 

Definition at line 71 of file cardMaker.h.

LVecBase4f CardMaker::_frame [private]
 

Definition at line 68 of file cardMaker.h.

Referenced by set_has_uvs().

bool CardMaker::_has_color [private]
 

Definition at line 70 of file cardMaker.h.

bool CardMaker::_has_uvs [private]
 

Definition at line 66 of file cardMaker.h.

TexCoordf CardMaker::_ll [private]
 

Definition at line 67 of file cardMaker.h.

Referenced by ~CardMaker().

LVecBase4f CardMaker::_source_frame [private]
 

Definition at line 74 of file cardMaker.h.

Referenced by set_color().

PointerTo< PandaNode > CardMaker::_source_geometry [private]
 

Definition at line 73 of file cardMaker.h.

Referenced by set_color().

TexCoordf CardMaker::_ur [private]
 

Definition at line 67 of file cardMaker.h.

Referenced by ~CardMaker().


The documentation for this class was generated from the following files:
Generated on Fri May 2 00:48:08 2003 for Panda by doxygen1.3