Panda3D
Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | Static Public Attributes | Protected Member Functions | Friends

WindowFramework Class Reference

This encapsulates the data that is normally associated with a single window, or with a single display region within a window. More...

#include "windowFramework.h"

Inheritance diagram for WindowFramework:
TypedWritableReferenceCount TypedWritable ReferenceCount TypedObject MemoryBase MemoryBase

List of all members.

Public Types

enum  BackgroundType {
  BT_other = 0, BT_default, BT_black, BT_gray,
  BT_white, BT_none
}
enum  SplitType { ST_default, ST_horizontal, ST_vertical }

Public Member Functions

void adjust_aspect_ratio ()
 Reevaluates the aspect ratio of the window, presumably after the window has been resized by the user or some other force.
virtual ReferenceCountas_reference_count ()
 Returns the pointer cast to a ReferenceCount pointer, if it is in fact of that type.
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.
void center_trackball (const NodePath &object)
 Centers the trackball on the indicated object, and scales the trackball motion suitably.
virtual int complete_pointers (TypedWritable **p_list, BamReader *manager)
 Receives an array of pointers, one for each time manager->read_pointer() was called in fillin().
void enable_keyboard ()
 Creates a ButtonThrower to listen to button presses and throw them as events.
string encode_to_bam_stream () const
 Converts the TypedWritable object into a single stream of data using a BamWriter, and returns that data as a string string.
bool encode_to_bam_stream (string &data, BamWriter *writer=NULL) const
 Converts the TypedWritable object into a single stream of data using a BamWriter, and stores that data in the indicated string.
virtual void fillin (DatagramIterator &scan, BamReader *manager)
 This internal function is intended to be called by each class's make_from_bam() method to read in all of the relevant data from the BamFile for the new object.
virtual void finalize (BamReader *manager)
 Called by the BamReader to perform any final actions needed for setting up the object after all objects have been read and all pointers have been completed.
virtual TypeHandle force_init_type ()
bool get_anim_controls () const
 Returns the current state of the anim_controls flag.
NodePath get_aspect_2d ()
 Returns the node under the 2-d scene graph that is scaled to suit the window's aspect ratio.
BackgroundType get_background_type () const
 Returns the current background type setting.
UpdateSeq get_bam_modified () const
 Returns the current bam_modified counter.
int get_best_parent_from_Set (const std::set< int > &) const
NodePath get_button_thrower ()
 Returns the node in the data graph corresponding to the ButtonThrower object associated with this window.
Cameraget_camera (int n) const
 Returns the nth camera associated with the window.
NodePath get_camera_group ()
 Returns the node above the collection of 3-d cameras in the scene graph.
DisplayRegionget_display_region_2d () const
 Returns the default DisplayRegion created for the 2-d scene (render2d).
DisplayRegionget_display_region_3d () const
 Returns the default DisplayRegion created for the 3-d scene (render).
GraphicsOutputget_graphics_output () const
 Returns a pointer to the underlying GraphicsOutput object.
GraphicsWindowget_graphics_window () const
 Returns a pointer to the underlying GraphicsWindow object, if it is in fact a window; or NULL if it is not.
bool get_lighting () const
 Returns the current state of the lighting flag.
NodePath get_mouse ()
 Returns the node in the data graph corresponding to the mouse associated with this window.
int get_num_cameras () const
 Returns the number of 3-d cameras associated with the window.
bool get_one_sided_reverse () const
 Returns the current state of the one_sided_reverse flag.
PandaFrameworkget_panda_framework () const
 Returns a pointer to the associated PandaFramework object.
bool get_perpixel () const
 Returns the current state of the perpixel flag.
int get_ref_count () const
 Returns the current reference count.
NodePath get_render ()
 Returns the root of the 3-d scene graph.
NodePath get_render_2d ()
 Returns the root of the 2-d scene graph.
bool get_texture () const
 Returns the current state of the texture flag.
bool get_two_sided () const
 Returns the current state of the two_sided flag.
virtual TypeHandle get_type () const
int get_type_index () const
 Returns the internal index number associated with this object's TypeHandle, a unique number for each different type.
WeakReferenceListget_weak_list () const
 Returns the WeakReferenceList associated with this ReferenceCount object.
bool get_wireframe () const
 Returns the current state of the wireframe flag.
bool has_weak_list () const
 Returns true if this particular ReferenceCount object has a WeakReferenceList created, false otherwise.
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.
NodePath load_default_model (const NodePath &parent)
 Loads our favorite blue triangle.
NodePath load_model (const NodePath &parent, Filename filename)
 Loads up the indicated model and returns the new NodePath, or the empty NodePath if the model could not be loaded.
bool load_models (const NodePath &parent, int argc, char *argv[], int first_arg=1)
 Loads up all the model files listed in the indicated argument list.
bool load_models (const NodePath &parent, const pvector< Filename > &files)
 Loads up all the model files listed in the indicated argument list.
void local_object ()
 This function should be called, once, immediately after creating a new instance of some ReferenceCount-derived object on the stack.
void loop_animations (int hierarchy_match_flags=PartGroup::HMF_ok_part_extra|PartGroup::HMF_ok_anim_extra)
 Looks for characters and their matching animation files in the scene graph; binds and loops any matching animations found.
NodePath make_camera ()
 Makes a new 3-d camera for the window.
void mark_bam_modified ()
 Increments the bam_modified counter, so that this object will be invalidated and retransmitted on any open bam streams.
void next_anim_control ()
 Rotates the animation controls through all of the available animations.
void operator delete (void *ptr)
void operator delete (void *ptr, void *)
void operator delete (void *ptr)
void operator delete (void *ptr, void *)
void operator delete[] (void *ptr)
void operator delete[] (void *ptr)
void operator delete[] (void *, void *)
void operator delete[] (void *, void *)
void * operator new (size_t size)
void * operator new (size_t size, void *ptr)
void * operator new (size_t size, void *ptr)
void * operator new (size_t size)
void * operator new[] (size_t size)
void * operator new[] (size_t size, void *ptr)
void * operator new[] (size_t size, void *ptr)
void * operator new[] (size_t size)
void ref () const
 Explicitly increments the reference count.
virtual bool require_fully_complete () const
 Some objects require all of their nested pointers to have been completed before the objects themselves can be completed.
void set_anim_controls (bool enable)
 Creates an onscreen animation slider for frame-stepping through the animations.
void set_background_type (BackgroundType type)
 Sets the background of the window to one of the pre-canned background types (or to BT_other, which indicates the user intends to set up his own special background mode).
void set_lighting (bool enable)
 Turns lighting on (true) or off (false).
void set_one_sided_reverse (bool enable)
 Toggles one-sided reverse mode.
void set_perpixel (bool enable)
 Turns per-pixel lighting on (true) or off (false).
void set_texture (bool enable)
 Forces textures off (false) or restores default rendering (true).
void set_two_sided (bool enable)
 Forces two-sided rendering (true) or restores default rendering (false).
void set_wireframe (bool enable)
 Forces wireframe state (true) or restores default rendering (false).
void setup_trackball ()
 Sets up the mouse to trackball around the camera.
WindowFrameworksplit_window (SplitType split_type=ST_default)
 Divides the window into two display regions, each of which gets its own trackball and keyboard events.
void stagger_animations ()
 Walks through all the animations that were bound by loop_animations() and staggers their play rate slightly so that they will not remain perfectly in sync.
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.
virtual void update_bam_nested (BamWriter *manager)
 Called by the BamWriter when this object has not itself been modified recently, but it should check its nested objects for updates.
void weak_ref (WeakPointerToVoid *ptv)
 Adds the indicated PointerToVoid as a weak reference to this object.
void weak_unref (WeakPointerToVoid *ptv)
 Removes the indicated PointerToVoid as a weak reference to this object.
virtual void write_datagram (BamWriter *manager, Datagram &dg)
 Writes the contents of this object to the datagram for shipping out to a Bam file.

Static Public Member Functions

static bool decode_raw_from_bam_stream (TypedWritable *&ptr, ReferenceCount *&ref_ptr, const string &data, BamReader *reader=NULL)
 Reads the string created by a previous call to encode_to_bam_stream(), and extracts the single object on that string.
static TypeHandle get_class_type ()
static TextFontget_shuttle_controls_font ()
 Returns a font that contains the shuttle controls icons.
static void init_type ()
static PT (TypedWritableReferenceCount) decode_from_bam_stream(const string &data

Public Attributes

static BamReaderreader = NULL)

Static Public Attributes

static TypedWritable *const Null = (TypedWritable*)0L

Protected Member Functions

 WindowFramework (PandaFramework *panda_framework)
 WindowFramework (const WindowFramework &copy, DisplayRegion *display_region)
void close_window ()
 Closes the window or buffer.
bool do_test_ref_count_integrity () const
 Does some easy checks to make sure that the reference count isn't completely bogus.
bool do_test_ref_count_nonzero () const
 Returns true if the reference count is nonzero, false otherwise.
GraphicsOutputopen_window (const WindowProperties &props, int flags, GraphicsEngine *engine, GraphicsPipe *pipe, GraphicsStateGuardian *gsg=NULL)
 Opens the actual window or buffer.
void setup_lights ()
 Makes light nodes and attaches them to the camera for viewing the scene.

Friends

class PandaFramework

Detailed Description

This encapsulates the data that is normally associated with a single window, or with a single display region within a window.

(In the case where a window has been subdivided with split_window(), there may be multiple WindowFrameworks objects that share the same GraphicsOutput pointer, but reference different display regions within that window).

Definition at line 55 of file windowFramework.h.


Member Function Documentation

void WindowFramework::adjust_aspect_ratio ( )

Reevaluates the aspect ratio of the window, presumably after the window has been resized by the user or some other force.

Adjusts the render film size and aspect2d scale as necessary according to the new window shape, or new config setting.

Definition at line 801 of file windowFramework.cxx.

References NodePath::is_empty(), Lens::set_aspect_ratio(), Lens::set_film_size(), and NodePath::set_scale().

ReferenceCount * TypedWritableReferenceCount::as_reference_count ( ) [virtual, inherited]

Returns the pointer cast to a ReferenceCount pointer, if it is in fact of that type.

Reimplemented from TypedWritable.

Definition at line 26 of file typedWritableReferenceCount.cxx.

TypedObject * TypedObject::as_typed_object ( ) [inline, inherited]

Returns the object, upcast (if necessary) to a TypedObject pointer.

Definition at line 99 of file typedObject.I.

const TypedObject * TypedObject::as_typed_object ( ) const [inline, inherited]

Returns the object, upcast (if necessary) to a TypedObject pointer.

Definition at line 110 of file typedObject.I.

void WindowFramework::center_trackball ( const NodePath object)

Centers the trackball on the indicated object, and scales the trackball motion suitably.

Definition at line 457 of file windowFramework.cxx.

References LVector3f::forward(), Lens::get_default_far(), Lens::get_default_near(), Lens::get_fov(), Lens::set_far(), and Lens::set_near().

Referenced by PandaFramework::event_c().

void WindowFramework::close_window ( ) [protected]

Closes the window or buffer.

This is normally called from PandaFramework::close_window().

Definition at line 203 of file windowFramework.cxx.

References NodePath::remove_node().

Referenced by PandaFramework::close_all_windows().

int TypedWritable::complete_pointers ( TypedWritable **  p_list,
BamReader manager 
) [virtual, inherited]

Receives an array of pointers, one for each time manager->read_pointer() was called in fillin().

Returns the number of pointers processed.

This is the callback function that is made by the BamReader at some later point, after all of the required pointers have been filled in. It is necessary because there might be forward references in a bam file; when we call read_pointer() in fillin(), the object may not have been read from the file yet, so we do not have a pointer available at that time. Thus, instead of returning a pointer, read_pointer() simply reserves a later callback. This function provides that callback. The calling object is responsible for keeping track of the number of times it called read_pointer() and extracting the same number of pointers out of the supplied vector, and storing them appropriately within the object.

Reimplemented in CFDoCullCommand, AnimBundleNode, AnimChannelMatrixDynamic, AnimChannelScalarDynamic, AnimGroup, MovingPartBase, PartBundle, PartBundleNode, PartGroup, Character, CharacterJoint, CharacterJointEffect, CharacterVertexSlider, JointVertexTransform, CollisionNode, DataNodeTransmit, GeomVertexArrayData, GeomVertexArrayFormat, GeomVertexData, GeomVertexFormat, SliderTable, TextureStage, TransformBlendTable, TransformTable, PiecewiseCurve, ClipPlaneAttrib, FogAttrib, LensNode, LightAttrib, MaterialAttrib, PortalNode, RenderEffects, RenderState, TexGenAttrib, TexMatrixAttrib, TexProjectorEffect, TextureAttrib, BamCacheIndex, RecorderFrame, EggFile, ImageFile, PaletteGroup, PaletteGroups, PaletteImage, PalettePage, Palettizer, SourceTextureImage, TextureImage, TexturePlacement, TextureProperties, and TextureReference.

Definition at line 103 of file typedWritable.cxx.

bool TypedWritable::decode_raw_from_bam_stream ( TypedWritable *&  ptr,
ReferenceCount *&  ref_ptr,
const string &  data,
BamReader reader = NULL 
) [static, inherited]

Reads the string created by a previous call to encode_to_bam_stream(), and extracts the single object on that string.

Returns true on success, false on on error.

This variant sets the TypedWritable and ReferenceCount pointers separately; both are pointers to the same object. The reference count is not incremented; it is the caller's responsibility to manage the reference count.

Note that this method cannot be used to retrieve objects that do not inherit from ReferenceCount, because these objects cannot persist beyond the lifetime of the BamReader that reads them. To retrieve these objects from a bam stream, you must construct a BamReader directly.

If you happen to know that the particular object in question inherits from TypedWritableReferenceCount or PandaNode, consider calling the variant of decode_from_bam_stream() defined for those methods, which presents a simpler interface.

Definition at line 353 of file typedWritable.cxx.

References BamReader::init(), DatagramInputFile::open(), DatagramInputFile::read_header(), BamReader::read_object(), ReferenceCount::ref(), BamReader::resolve(), BamReader::set_source(), and ReferenceCount::unref().

bool ReferenceCount::do_test_ref_count_integrity ( ) const [protected, inherited]

Does some easy checks to make sure that the reference count isn't completely bogus.

Returns true if ok, false otherwise.

Reimplemented in NodeReferenceCount, CachedTypedWritableReferenceCount, and NodeCachedReferenceCount.

Definition at line 29 of file referenceCount.cxx.

Referenced by ReferenceCount::do_test_ref_count_nonzero(), and ReferenceCount::test_ref_count_integrity().

bool ReferenceCount::do_test_ref_count_nonzero ( ) const [protected, inherited]

Returns true if the reference count is nonzero, false otherwise.

Definition at line 56 of file referenceCount.cxx.

References ReferenceCount::do_test_ref_count_integrity().

Referenced by ReferenceCount::test_ref_count_nonzero().

void WindowFramework::enable_keyboard ( )

Creates a ButtonThrower to listen to button presses and throw them as events.

Definition at line 397 of file windowFramework.cxx.

References ModifierButtons::add_button(), NodePath::attach_new_node(), and get_mouse().

string TypedWritable::encode_to_bam_stream ( ) const [inline, inherited]

Converts the TypedWritable object into a single stream of data using a BamWriter, and returns that data as a string string.

Returns empty string on failure.

This is a convenience method particularly useful for cases when you are only serializing a single object. If you have many objects to process, it is more efficient to use the same BamWriter to serialize all of them together.

Definition at line 86 of file typedWritable.I.

bool TypedWritable::encode_to_bam_stream ( string &  data,
BamWriter writer = NULL 
) const [inherited]

Converts the TypedWritable object into a single stream of data using a BamWriter, and stores that data in the indicated string.

Returns true on success, false on failure.

This is a convenience method particularly useful for cases when you are only serializing a single object. If you have many objects to process, it is more efficient to use the same BamWriter to serialize all of them together.

Definition at line 283 of file typedWritable.cxx.

References BamWriter::init(), DatagramOutputFile::open(), BamWriter::set_target(), DatagramOutputFile::write_header(), and BamWriter::write_object().

void TypedWritable::fillin ( DatagramIterator scan,
BamReader manager 
) [virtual, inherited]

This internal function is intended to be called by each class's make_from_bam() method to read in all of the relevant data from the BamFile for the new object.

It is also called directly by the BamReader to re-read the data for an object that has been placed on the stream for an update.

Reimplemented in CFDoCullCommand, AnimBundle, AnimBundleNode, AnimChannelBase, AnimChannelMatrixDynamic, AnimChannelMatrixFixed, AnimChannelMatrixXfmTable, AnimChannelScalarDynamic, AnimChannelScalarTable, AnimGroup, AnimPreloadTable, MovingPart< SwitchType >, MovingPartBase, PartBundle, PartBundleNode, PartGroup, Character, CharacterJoint, CharacterJointEffect, CharacterVertexSlider, JointVertexTransform, CollisionBox, CollisionDSSolid, CollisionFloorMesh, CollisionInvSphere, CollisionLine, CollisionNode, CollisionParabola, CollisionPlane, CollisionPolygon, CollisionRay, CollisionSegment, CollisionSolid, CollisionSphere, CollisionTube, DataNode, DataNodeTransmit, ButtonEventList, EventStoreValue< Type >, Geom, GeomPrimitive, GeomVertexArrayData, GeomVertexArrayFormat, GeomVertexData, GeomVertexFormat, Lens, Material, SliderTable, TextureStage, TransformBlendTable, TransformTable, UserVertexSlider, UserVertexTransform, VertexSlider, VertexTransform, CubicCurveseg, HermiteCurve, NurbsCurve, ParametricCurve, PiecewiseCurve, RopeNode, SheetNode, AlphaTestAttrib, AntialiasAttrib, AudioVolumeAttrib, AuxBitplaneAttrib, BillboardEffect, Camera, ClipPlaneAttrib, ColorAttrib, ColorBlendAttrib, ColorScaleAttrib, ColorWriteAttrib, CompassEffect, CullBinAttrib, CullFaceAttrib, DecalEffect, DepthOffsetAttrib, DepthTestAttrib, DepthWriteAttrib, Fog, FogAttrib, GeomNode, LensNode, LightAttrib, LightRampAttrib, MaterialAttrib, ModelNode, ModelRoot, PandaNode, PlaneNode, PolylightNode, PortalNode, RenderAttrib, RenderEffect, RenderEffects, RenderModeAttrib, RenderState, RescaleNormalAttrib, ScissorAttrib, ScissorEffect, ShadeModelAttrib, ShowBoundsEffect, StencilAttrib, TexGenAttrib, TexMatrixAttrib, TexProjectorEffect, TextureAttrib, TransformState, TransparencyAttrib, UvScrollNode, AmbientLight, CallbackNode, DirectionalLight, FadeLODNode, LightLensNode, LightNode, LODNode, PointLight, SequenceNode, Spotlight, SwitchNode, BamCacheIndex, BamCacheRecord, MouseRecorder, RecorderFrame, RecorderHeader, RecorderTable, DestTextureImage, EggFile, ImageFile, PaletteGroup, PaletteGroups, PaletteImage, PalettePage, Palettizer, SourceTextureImage, TextureImage, TexturePlacement, TexturePosition, TextureProperties, TextureReference, MovingPart< ACScalarSwitchType >, and MovingPart< ACMatrixSwitchType >.

Definition at line 133 of file typedWritable.cxx.

Referenced by EventStoreValue< Type >::fillin().

void TypedWritable::finalize ( BamReader manager) [virtual, inherited]

Called by the BamReader to perform any final actions needed for setting up the object after all objects have been read and all pointers have been completed.

Reimplemented in PartBundle, Geom, GeomPrimitive, GeomVertexArrayData, GeomVertexArrayFormat, GeomVertexData, InternalName, GeomNode, LightAttrib, RenderAttrib, RenderEffect, RenderEffects, RenderState, PaletteGroup, and Palettizer.

Definition at line 145 of file typedWritable.cxx.

Referenced by BamReader::finalize_now().

bool WindowFramework::get_anim_controls ( ) const [inline]

Returns the current state of the anim_controls flag.

Definition at line 106 of file windowFramework.I.

NodePath WindowFramework::get_aspect_2d ( )

Returns the node under the 2-d scene graph that is scaled to suit the window's aspect ratio.

Definition at line 321 of file windowFramework.cxx.

References NodePath::attach_new_node(), get_mouse(), get_render_2d(), NodePath::is_empty(), TypedObject::is_of_type(), NodePath::node(), PGTop::set_mouse_watcher(), and NodePath::set_scale().

Referenced by PandaFramework::event_f9(), and PandaFramework::event_question().

WindowFramework::BackgroundType WindowFramework::get_background_type ( ) const [inline]

Returns the current background type setting.

Definition at line 176 of file windowFramework.I.

Referenced by PandaFramework::event_comma().

UpdateSeq TypedWritable::get_bam_modified ( ) const [inline, inherited]

Returns the current bam_modified counter.

This counter is normally incremented automatically whenever the object is modified.

Definition at line 66 of file typedWritable.I.

Referenced by BamWriter::consider_update(), and BamWriter::write_pointer().

NodePath WindowFramework::get_button_thrower ( )

Returns the node in the data graph corresponding to the ButtonThrower object associated with this window.

Definition at line 386 of file windowFramework.cxx.

Camera * WindowFramework::get_camera ( int  n) const [inline]

Returns the nth camera associated with the window.

Definition at line 73 of file windowFramework.I.

NodePath WindowFramework::get_camera_group ( )

Returns the node above the collection of 3-d cameras in the scene graph.

This node may be moved around to represent the viewpoint.

Definition at line 241 of file windowFramework.cxx.

References NodePath::attach_new_node(), get_render(), and NodePath::is_empty().

Referenced by make_camera(), setup_lights(), and setup_trackball().

DisplayRegion * WindowFramework::get_display_region_2d ( ) const [inline]

Returns the default DisplayRegion created for the 2-d scene (render2d).

Definition at line 85 of file windowFramework.I.

DisplayRegion * WindowFramework::get_display_region_3d ( ) const [inline]

Returns the default DisplayRegion created for the 3-d scene (render).

Definition at line 96 of file windowFramework.I.

GraphicsOutput * WindowFramework::get_graphics_output ( ) const [inline]
GraphicsWindow * WindowFramework::get_graphics_window ( ) const [inline]

Returns a pointer to the underlying GraphicsWindow object, if it is in fact a window; or NULL if it is not.

Definition at line 35 of file windowFramework.I.

bool WindowFramework::get_lighting ( ) const [inline]

Returns the current state of the lighting flag.

Definition at line 156 of file windowFramework.I.

Referenced by PandaFramework::event_l().

NodePath WindowFramework::get_mouse ( )

Returns the node in the data graph corresponding to the mouse associated with this window.

Definition at line 360 of file windowFramework.cxx.

References NodePath::attach_new_node(), PandaFramework::get_mouse(), and NodePath::is_empty().

Referenced by enable_keyboard(), get_aspect_2d(), and setup_trackball().

int WindowFramework::get_num_cameras ( ) const [inline]

Returns the number of 3-d cameras associated with the window.

A window usually has only one camera, but it may have multiple cameras if there are multiple display regions within the window.

Definition at line 63 of file windowFramework.I.

bool WindowFramework::get_one_sided_reverse ( ) const [inline]

Returns the current state of the one_sided_reverse flag.

Definition at line 146 of file windowFramework.I.

Referenced by PandaFramework::event_i().

PandaFramework * WindowFramework::get_panda_framework ( ) const [inline]

Returns a pointer to the associated PandaFramework object.

Definition at line 23 of file windowFramework.I.

bool WindowFramework::get_perpixel ( ) const [inline]

Returns the current state of the perpixel flag.

Definition at line 166 of file windowFramework.I.

Referenced by PandaFramework::event_p().

int ReferenceCount::get_ref_count ( ) const [inline, inherited]
NodePath WindowFramework::get_render ( )
NodePath WindowFramework::get_render_2d ( )
TextFont * WindowFramework::get_shuttle_controls_font ( ) [static]

Returns a font that contains the shuttle controls icons.

Definition at line 1114 of file windowFramework.cxx.

References BamFile::open_read().

bool WindowFramework::get_texture ( ) const [inline]

Returns the current state of the texture flag.

Definition at line 126 of file windowFramework.I.

Referenced by PandaFramework::event_t().

bool WindowFramework::get_two_sided ( ) const [inline]

Returns the current state of the two_sided flag.

Definition at line 136 of file windowFramework.I.

Referenced by PandaFramework::event_b().

int TypedObject::get_type_index ( ) const [inline, inherited]

Returns the internal index number associated with this object's TypeHandle, a unique number for each different type.

This is equivalent to get_type().get_index().

Definition at line 52 of file typedObject.I.

References TypeHandle::get_index().

WeakReferenceList * ReferenceCount::get_weak_list ( ) const [inline, inherited]

Returns the WeakReferenceList associated with this ReferenceCount object.

If there has never been a WeakReferenceList associated with this object, creates one now.

Definition at line 307 of file referenceCount.I.

Referenced by ReferenceCount::weak_ref().

bool WindowFramework::get_wireframe ( ) const [inline]

Returns the current state of the wireframe flag.

Definition at line 116 of file windowFramework.I.

Referenced by PandaFramework::event_w().

bool ReferenceCount::has_weak_list ( ) const [inline, inherited]

Returns true if this particular ReferenceCount object has a WeakReferenceList created, false otherwise.

In general, this will be true if there was ever a WeakPointerTo created for this object (even if there is not any for it now).

Definition at line 294 of file referenceCount.I.

Referenced by ReferenceCount::weak_unref().

bool TypedObject::is_exact_type ( TypeHandle  handle) const [inline, inherited]
bool TypedObject::is_of_type ( TypeHandle  handle) const [inline, inherited]

Returns true if the current object is or derives from the indicated type.

Definition at line 63 of file typedObject.I.

References TypeHandle::is_derived_from().

Referenced by EggSliderData::add_back_pointer(), EggJointData::add_back_pointer(), CIntervalManager::add_c_interval(), XFileNode::add_child(), CollisionTraverser::add_collider(), CollisionHandlerPhysical::add_collider(), EggXfmSAnim::add_data(), CharacterJointBundle::add_node(), NonlinearImager::add_screen(), EggGroupNode::apply_first_attribute(), EggGroupNode::apply_last_attribute(), DeferredNodeProperty::apply_to_node(), RecorderController::begin_playback(), NodePath::clear_clip_plane(), EggGroupNode::clear_connected_shading(), NodePath::clear_light(), EggBase::convert_paths(), NodePath::decode_from_bam_stream(), VrpnClient::disconnect_device(), PhysicsManager::do_physics(), GraphicsStateGuardian::fetch_specified_part(), EggRenderState::fill_state(), AnimBundleNode::find_anim_bundle(), EggGroupNode::find_coordsys_entry(), XFile::find_data_object(), Character::find_joint(), EggGroupNode::find_materials(), Character::find_slider(), XFile::find_template(), EggGroupNode::find_textures(), EggMaterialCollection::find_used_materials(), EggTextureCollection::find_used_textures(), EggGroupNode::force_filenames(), EggJointData::force_initial_rest_frame(), get_aspect_2d(), EggPoolUniquifier::get_category(), EggGroupUniquifier::get_category(), EggGroupNode::get_connected_shading(), PandaFramework::get_mouse(), FactoryParams::get_param_of_type(), EggGroupNode::has_absolute_pathnames(), NodePath::has_clip_plane(), NodePath::has_clip_plane_off(), NodePath::has_light(), PandaFramework::hide_collision_solids(), x11GraphicsWindow::open_window(), eglGraphicsWindow::open_window(), EggNode::parse_egg(), CharacterMaker::part_to_node(), EggGroupNode::post_apply_flat_attribute(), EggBinner::prepare_node(), PortalClipper::prepare_portal(), NodePath::project_texture(), EggMatrixTablePointer::quantize_channels(), ParametricCurveCollection::r_add_curves(), SceneGraphReducer::r_collect_vertex_data(), EggGroupNode::r_load_externals(), EggGroupNode::rebuild_vertex_pools(), EggGroupNode::recompute_polygon_normals(), EggGroupNode::remove_invalid_primitives(), EggGroupNode::remove_unused_vertices(), EggLoader::reparent_decals(), EggMaterialCollection::replace_materials(), EggTextureCollection::replace_textures(), EggGroupNode::resolve_filenames(), EggGroupNode::reverse_vertex_ordering(), NodePath::set_clip_plane(), NodePath::set_clip_plane_off(), NodePath::set_light(), ProjectionScreen::set_projector(), NonlinearImager::set_source_camera(), EggXfmSAnim::set_value(), NonlinearImager::set_viewer_camera(), PandaFramework::show_collision_solids(), BamCache::store(), XFileToEggConverter::strip_nodes(), EggGroupNode::strip_normals(), DataGraphTraverser::traverse(), DataGraphTraverser::traverse_below(), EggGroupNode::triangulate_polygons(), EggGroupNode::unify_attributes(), EggNameUniquifier::uniquify(), NodeCullCallbackData::upcall(), PhysicsCollisionHandler::validate_target(), EggXfmSAnim::write(), EggGroup::write(), EggToDXFLayer::write_3d_face(), and EggToDXFLayer::write_entities().

NodePath WindowFramework::load_default_model ( const NodePath parent)

Loads our favorite blue triangle.

This is intended to provide some default geometry to have *something* to look at for testing, when no other models are provided.

Definition at line 661 of file windowFramework.cxx.

References GeomVertexWriter::add_data2f(), GeomVertexWriter::add_data3f(), GeomNode::add_geom(), NodePath::attach_new_node(), LVector3f::back(), GeomVertexFormat::get_v3n3cpt2(), PNMImage::read(), and LPoint3f::rfu().

NodePath WindowFramework::load_model ( const NodePath parent,
Filename  filename 
)
bool WindowFramework::load_models ( const NodePath parent,
int  argc,
char *  argv[],
int  first_arg = 1 
)

Loads up all the model files listed in the indicated argument list.

If first_arg is supplied, it is the first argument in the list to consider.

Returns true if all models loaded successfully, or false if at least one of them had an error.

Definition at line 547 of file windowFramework.cxx.

References Filename::from_os_specific().

bool WindowFramework::load_models ( const NodePath parent,
const pvector< Filename > &  files 
)

Loads up all the model files listed in the indicated argument list.

Returns true if all models loaded successfully, or false if at least one of them had an error.

Definition at line 567 of file windowFramework.cxx.

References NodePath::is_empty(), and load_model().

void ReferenceCount::local_object ( ) [inline, inherited]

This function should be called, once, immediately after creating a new instance of some ReferenceCount-derived object on the stack.

This allows the object to be passed to functions that will increment and decrement the object's reference count temporarily, and it will prevent the object from being deleted (inappropriately), when the reference count returns to zero. It actually achieves this by setting a large positive value in the reference count field.

Definition at line 276 of file referenceCount.I.

Referenced by PGTop::cull_callback(), BoundingSphere::extend_by_hexahedron(), AsyncTaskManager::find_task(), AsyncTaskManager::find_tasks(), and AsyncTaskManager::find_tasks_matching().

void WindowFramework::loop_animations ( int  hierarchy_match_flags = PartGroup::HMF_ok_part_extra | PartGroup::HMF_ok_anim_extra)

Looks for characters and their matching animation files in the scene graph; binds and loops any matching animations found.

Definition at line 721 of file windowFramework.cxx.

References get_render(), and AnimControlCollection::loop_all().

NodePath WindowFramework::make_camera ( )

Makes a new 3-d camera for the window.

Definition at line 1138 of file windowFramework.cxx.

References NodePath::attach_new_node(), get_camera_group(), and Lens::set_aspect_ratio().

Referenced by open_window().

void TypedWritable::mark_bam_modified ( ) [inline, inherited]
void WindowFramework::next_anim_control ( )

Rotates the animation controls through all of the available animations.

If the animation controls are not already enabled, enables them at sets to the first animation; if they are already enabled, steps to the next animation; if that is the last animation, disables the animation controls.

Definition at line 758 of file windowFramework.cxx.

References AnimControlCollection::get_num_anims(), and set_anim_controls().

Referenced by PandaFramework::event_a().

GraphicsOutput * WindowFramework::open_window ( const WindowProperties props,
int  flags,
GraphicsEngine engine,
GraphicsPipe pipe,
GraphicsStateGuardian gsg = NULL 
) [protected]
void ReferenceCount::ref ( ) const [inline, inherited]

Explicitly increments the reference count.

User code should avoid using ref() and unref() directly, which can result in missed reference counts. Instead, let a PointerTo object manage the reference counting automatically.

This function is const, even though it changes the object, because generally fiddling with an object's reference count isn't considered part of fiddling with the object. An object might be const in other ways, but we still need to accurately count the number of references to it.

Definition at line 179 of file referenceCount.I.

References ReferenceCount::test_ref_count_integrity().

Referenced by CachedTypedWritableReferenceCount::cache_ref(), TypedWritable::decode_raw_from_bam_stream(), NodeCachedReferenceCount::node_ref(), NodeReferenceCount::node_ref(), BamCacheRecord::set_data(), CullableObject::set_draw_callback(), and ModelRoot::set_reference().

bool TypedWritable::require_fully_complete ( ) const [virtual, inherited]

Some objects require all of their nested pointers to have been completed before the objects themselves can be completed.

If this is the case, override this method to return true, and be careful with circular references (which would make the object unreadable from a bam file).

Reimplemented in GeomVertexData, ClipPlaneAttrib, and RenderEffects.

Definition at line 118 of file typedWritable.cxx.

void WindowFramework::set_anim_controls ( bool  enable)

Creates an onscreen animation slider for frame-stepping through the animations.

Definition at line 781 of file windowFramework.cxx.

Referenced by next_anim_control().

void WindowFramework::set_background_type ( WindowFramework::BackgroundType  type)

Sets the background of the window to one of the pre-canned background types (or to BT_other, which indicates the user intends to set up his own special background mode).

Definition at line 1052 of file windowFramework.cxx.

Referenced by PandaFramework::event_comma(), open_window(), and PandaFramework::set_background_type().

void WindowFramework::set_lighting ( bool  enable)

Turns lighting on (true) or off (false).

Definition at line 1001 of file windowFramework.cxx.

References NodePath::clear_light(), get_render(), NodePath::set_light(), and setup_lights().

Referenced by PandaFramework::event_l(), and PandaFramework::set_lighting().

void WindowFramework::set_one_sided_reverse ( bool  enable)

Toggles one-sided reverse mode.

In this mode, the front sides of one-sided polygons are culled instead of the back side.

Definition at line 975 of file windowFramework.cxx.

References NodePath::clear_two_sided(), get_render(), NodePath::node(), and PandaNode::set_attrib().

Referenced by PandaFramework::event_i().

void WindowFramework::set_perpixel ( bool  enable)

Turns per-pixel lighting on (true) or off (false).

Definition at line 1027 of file windowFramework.cxx.

References get_render().

Referenced by PandaFramework::event_p(), and PandaFramework::set_perpixel().

void WindowFramework::set_texture ( bool  enable)

Forces textures off (false) or restores default rendering (true).

Definition at line 925 of file windowFramework.cxx.

References NodePath::clear_texture(), get_render(), and NodePath::set_texture_off().

Referenced by PandaFramework::event_t(), and PandaFramework::set_texture().

void WindowFramework::set_two_sided ( bool  enable)

Forces two-sided rendering (true) or restores default rendering (false).

Definition at line 948 of file windowFramework.cxx.

References NodePath::clear_two_sided(), get_render(), and NodePath::set_two_sided().

Referenced by PandaFramework::event_b(), and PandaFramework::set_two_sided().

void WindowFramework::set_wireframe ( bool  enable)
void WindowFramework::setup_lights ( ) [protected]

Makes light nodes and attaches them to the camera for viewing the scene.

Definition at line 1174 of file windowFramework.cxx.

References NodePath::attach_new_node(), get_camera_group(), Light::set_color(), and NodePath::set_hpr().

Referenced by set_lighting().

void WindowFramework::setup_trackball ( )

Sets up the mouse to trackball around the camera.

Definition at line 428 of file windowFramework.cxx.

References NodePath::attach_new_node(), LVector3f::forward(), get_camera_group(), get_mouse(), and NodePath::node().

WindowFramework * WindowFramework::split_window ( SplitType  split_type = ST_default)

Divides the window into two display regions, each of which gets its own trackball and keyboard events.

The new window pointer is returned.

There is not an interface for recombining divided windows.

Definition at line 845 of file windowFramework.cxx.

References DisplayRegion::get_window(), GraphicsOutput::make_display_region(), and DisplayRegion::set_dimensions().

void WindowFramework::stagger_animations ( )

Walks through all the animations that were bound by loop_animations() and staggers their play rate slightly so that they will not remain perfectly in sync.

Definition at line 738 of file windowFramework.cxx.

References AnimControlCollection::get_anim(), AnimControlCollection::get_num_anims(), and AnimInterface::set_play_rate().

bool ReferenceCount::test_ref_count_integrity ( ) const [inline, inherited]
bool ReferenceCount::test_ref_count_nonzero ( ) const [inline, inherited]

Does some easy checks to make sure that the reference count isn't zero, or completely bogus.

Returns true if ok, false otherwise.

Definition at line 252 of file referenceCount.I.

References ReferenceCount::do_test_ref_count_nonzero().

Referenced by CopyOnWritePointer::test_ref_count_nonzero().

bool ReferenceCount::unref ( ) const [inline, virtual, inherited]

Explicitly decrements the reference count.

Note that the object will not be implicitly deleted by unref() simply because the reference count drops to zero. (Having a member function delete itself is problematic.) However, see the helper function unref_delete().

User code should avoid using ref() and unref() directly, which can result in missed reference counts. Instead, let a PointerTo object manage the reference counting automatically.

This function is const, even though it changes the object, because generally fiddling with an object's reference count isn't considered part of fiddling with the object. An object might be const in other ways, but we still need to accurately count the number of references to it.

The return value is true if the new reference count is nonzero, false if it is zero.

Reimplemented in GeomVertexArrayFormat, GeomVertexFormat, InternalName, RenderAttrib, RenderEffects, RenderState, and TransformState.

Definition at line 214 of file referenceCount.I.

References ReferenceCount::test_ref_count_integrity().

Referenced by CachedTypedWritableReferenceCount::cache_unref(), TypedWritable::decode_raw_from_bam_stream(), RenderEffect::finalize(), NodeCachedReferenceCount::node_unref(), NodeReferenceCount::node_unref(), TransformState::unref(), RenderState::unref(), RenderEffects::unref(), RenderAttrib::unref(), InternalName::unref(), GeomVertexFormat::unref(), and GeomVertexArrayFormat::unref().

void TypedWritable::update_bam_nested ( BamWriter manager) [virtual, inherited]

Called by the BamWriter when this object has not itself been modified recently, but it should check its nested objects for updates.

Reimplemented in CFDoCullCommand, and PandaNode.

Definition at line 77 of file typedWritable.cxx.

void ReferenceCount::weak_ref ( WeakPointerToVoid ptv) [inline, inherited]

Adds the indicated PointerToVoid as a weak reference to this object.

Definition at line 321 of file referenceCount.I.

References WeakReferenceList::add_reference(), and ReferenceCount::get_weak_list().

void ReferenceCount::weak_unref ( WeakPointerToVoid ptv) [inline, inherited]

Removes the indicated PointerToVoid as a weak reference to this object.

It must have previously been added via a call to weak_ref().

Definition at line 334 of file referenceCount.I.

References WeakReferenceList::clear_reference(), and ReferenceCount::has_weak_list().

void TypedWritable::write_datagram ( BamWriter manager,
Datagram dg 
) [virtual, inherited]

Writes the contents of this object to the datagram for shipping out to a Bam file.

Reimplemented in CFDoCullCommand, AnimBundle, AnimBundleNode, AnimChannelBase, AnimChannelMatrixDynamic, AnimChannelMatrixFixed, AnimChannelMatrixXfmTable, AnimChannelScalarDynamic, AnimChannelScalarTable, AnimGroup, AnimPreloadTable, MovingPart< SwitchType >, MovingPartBase, PartBundle, PartBundleNode, PartGroup, Character, CharacterJoint, CharacterJointEffect, CharacterVertexSlider, JointVertexTransform, CollisionBox, CollisionDSSolid, CollisionFloorMesh, CollisionInvSphere, CollisionLine, CollisionNode, CollisionParabola, CollisionPlane, CollisionPolygon, CollisionRay, CollisionSegment, CollisionSolid, CollisionSphere, CollisionTube, DataNode, DataNodeTransmit, ButtonEventList, EventStoreValue< Type >, Geom, GeomPrimitive, GeomVertexArrayData, GeomVertexArrayFormat, GeomVertexData, GeomVertexFormat, InternalName, Lens, Material, SliderTable, Texture, TextureStage, TransformBlendTable, TransformTable, UserVertexSlider, UserVertexTransform, VertexSlider, VertexTransform, CubicCurveseg, HermiteCurve, NurbsCurve, ParametricCurve, PiecewiseCurve, RopeNode, SheetNode, AlphaTestAttrib, AntialiasAttrib, AudioVolumeAttrib, AuxBitplaneAttrib, BillboardEffect, Camera, ClipPlaneAttrib, ColorAttrib, ColorBlendAttrib, ColorScaleAttrib, ColorWriteAttrib, CompassEffect, CullBinAttrib, CullFaceAttrib, DecalEffect, DepthOffsetAttrib, DepthTestAttrib, DepthWriteAttrib, Fog, FogAttrib, GeomNode, LensNode, LightAttrib, LightRampAttrib, MaterialAttrib, ModelNode, ModelRoot, PandaNode, PlaneNode, PolylightNode, PortalNode, RenderAttrib, RenderEffect, RenderEffects, RenderModeAttrib, RenderState, RescaleNormalAttrib, ScissorAttrib, ScissorEffect, ShadeModelAttrib, ShowBoundsEffect, StencilAttrib, TexGenAttrib, TexMatrixAttrib, TexProjectorEffect, TextureAttrib, TransformState, TransparencyAttrib, UvScrollNode, AmbientLight, CallbackNode, DirectionalLight, FadeLODNode, LightLensNode, LightNode, LODNode, PointLight, SequenceNode, Spotlight, SwitchNode, PNMFileType, BamCacheIndex, BamCacheRecord, WritableConfigurable, MouseRecorder, RecorderFrame, RecorderHeader, RecorderTable, DestTextureImage, EggFile, ImageFile, PaletteGroup, PaletteGroups, PaletteImage, PalettePage, Palettizer, SourceTextureImage, TextureImage, TexturePlacement, TexturePosition, TextureProperties, TextureReference, MovingPart< ACScalarSwitchType >, and MovingPart< ACMatrixSwitchType >.

Definition at line 66 of file typedWritable.cxx.

Referenced by GeomPrimitive::write_datagram(), and EventStoreValue< Type >::write_datagram().


The documentation for this class was generated from the following files:
 All Classes Functions Variables Enumerations