keep attrib and trans separate

This commit is contained in:
David Rose 2001-07-24 23:55:10 +00:00
parent 22177f130f
commit 747f247745
7 changed files with 18 additions and 14 deletions

View File

@ -132,8 +132,9 @@ make_copy() const {
//////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////
void PGEntry:: void PGEntry::
draw_item(PGTop *top, GraphicsStateGuardian *gsg, draw_item(PGTop *top, GraphicsStateGuardian *gsg,
const AllAttributesWrapper &attrib) { const AllAttributesWrapper &attrib,
PGItem::draw_item(top, gsg, attrib); const AllTransitionsWrapper &trans) {
PGItem::draw_item(top, gsg, attrib, trans);
update_text(); update_text();
update_cursor(); update_cursor();
@ -143,7 +144,7 @@ draw_item(PGTop *top, GraphicsStateGuardian *gsg,
// of the text. // of the text.
DirectRenderTraverser drt(gsg, RenderRelation::get_class_type()); DirectRenderTraverser drt(gsg, RenderRelation::get_class_type());
drt.set_view_frustum_cull(false); drt.set_view_frustum_cull(false);
drt.traverse(_text_render_root, attrib, AllTransitionsWrapper()); drt.traverse(_text_render_root, attrib, trans);
} }
//////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////

View File

@ -46,7 +46,8 @@ public:
virtual Node *make_copy() const; virtual Node *make_copy() const;
virtual void draw_item(PGTop *top, GraphicsStateGuardian *gsg, virtual void draw_item(PGTop *top, GraphicsStateGuardian *gsg,
const AllAttributesWrapper &attrib); const AllAttributesWrapper &attrib,
const AllTransitionsWrapper &trans);
virtual void press(const MouseWatcherParameter &param); virtual void press(const MouseWatcherParameter &param);

View File

@ -200,7 +200,8 @@ activate_region(PGTop *, const LMatrix4f &transform, int sort) {
//////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////
void PGItem:: void PGItem::
draw_item(PGTop *top, GraphicsStateGuardian *gsg, draw_item(PGTop *top, GraphicsStateGuardian *gsg,
const AllAttributesWrapper &attrib) { const AllAttributesWrapper &attrib,
const AllTransitionsWrapper &trans) {
if (has_state_def(get_state())) { if (has_state_def(get_state())) {
// This item has a current state definition that we should use // This item has a current state definition that we should use
// to render the item. // to render the item.
@ -211,11 +212,11 @@ draw_item(PGTop *top, GraphicsStateGuardian *gsg,
// of the subgraph. // of the subgraph.
DirectRenderTraverser drt(gsg, RenderRelation::get_class_type()); DirectRenderTraverser drt(gsg, RenderRelation::get_class_type());
drt.set_view_frustum_cull(false); drt.set_view_frustum_cull(false);
drt.traverse(def, attrib, AllTransitionsWrapper()); drt.traverse(def, attrib, trans);
} else { } else {
QuickRenderTraverser qrt(gsg, RenderRelation::get_class_type()); QuickRenderTraverser qrt(gsg, RenderRelation::get_class_type());
qrt.traverse(def, attrib, AllTransitionsWrapper()); qrt.traverse(def, attrib, trans);
} }
} }
} }

View File

@ -72,7 +72,8 @@ public:
INLINE PGMouseWatcherRegion *get_region() const; INLINE PGMouseWatcherRegion *get_region() const;
virtual void draw_item(PGTop *top, GraphicsStateGuardian *gsg, virtual void draw_item(PGTop *top, GraphicsStateGuardian *gsg,
const AllAttributesWrapper &attrib); const AllAttributesWrapper &attrib,
const AllTransitionsWrapper &trans);
virtual void enter(const MouseWatcherParameter &param); virtual void enter(const MouseWatcherParameter &param);
virtual void exit(const MouseWatcherParameter &param); virtual void exit(const MouseWatcherParameter &param);

View File

@ -206,9 +206,7 @@ r_traverse(Node *node, const ArcChain &chain) {
AllTransitionsWrapper complete_trans; AllTransitionsWrapper complete_trans;
wrt(pgi, chain.begin(), chain.end(), this, wrt(pgi, chain.begin(), chain.end(), this,
complete_trans, RenderRelation::get_class_type()); complete_trans, RenderRelation::get_class_type());
AllAttributesWrapper render_state; pgi->draw_item(this, _gsg, _attrib, complete_trans);
render_state.apply_from(_attrib, complete_trans);
pgi->draw_item(this, _gsg, render_state);
} else if (node->is_of_type(GeomNode::get_class_type())) { } else if (node->is_of_type(GeomNode::get_class_type())) {
_gsg->_geom_nodes_pcollector.add_level(1); _gsg->_geom_nodes_pcollector.add_level(1);

View File

@ -96,9 +96,10 @@ make_copy() const {
//////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////
void PGWaitBar:: void PGWaitBar::
draw_item(PGTop *top, GraphicsStateGuardian *gsg, draw_item(PGTop *top, GraphicsStateGuardian *gsg,
const AllAttributesWrapper &attrib) { const AllAttributesWrapper &attrib,
const AllTransitionsWrapper &trans) {
update(); update();
PGItem::draw_item(top, gsg, attrib); PGItem::draw_item(top, gsg, attrib, trans);
} }
//////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////

View File

@ -42,7 +42,8 @@ public:
virtual Node *make_copy() const; virtual Node *make_copy() const;
virtual void draw_item(PGTop *top, GraphicsStateGuardian *gsg, virtual void draw_item(PGTop *top, GraphicsStateGuardian *gsg,
const AllAttributesWrapper &attrib); const AllAttributesWrapper &attrib,
const AllTransitionsWrapper &trans);
PUBLISHED: PUBLISHED:
void setup(float width, float height, float range); void setup(float width, float height, float range);