- Timestamp:
- Dec 25, 2009, 1:18:03 PM (15 years ago)
- Location:
- code/branches/pickup2
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/pickup2
- Property svn:mergeinfo changed
-
code/branches/pickup2/src/orxonox/overlays/OverlayGroup.cc
r5929 r6412 60 60 OverlayGroup::~OverlayGroup() 61 61 { 62 for (std::set< OrxonoxOverlay*>::iterator it = hudElements_.begin(); it != hudElements_.end(); ++it)62 for (std::set< SmartPtr<OrxonoxOverlay> >::iterator it = hudElements_.begin(); it != hudElements_.end(); ++it) 63 63 (*it)->destroy(); 64 this->hudElements_.clear(); 64 65 } 65 66 … … 83 84 void OverlayGroup::setScale(const Vector2& scale) 84 85 { 85 for (std::set< OrxonoxOverlay*>::iterator it = hudElements_.begin(); it != hudElements_.end(); ++it)86 for (std::set< SmartPtr<OrxonoxOverlay> >::iterator it = hudElements_.begin(); it != hudElements_.end(); ++it) 86 87 (*it)->scale(scale / this->scale_); 87 88 this->scale_ = scale; … … 91 92 void OverlayGroup::setScroll(const Vector2& scroll) 92 93 { 93 for (std::set< OrxonoxOverlay*>::iterator it = hudElements_.begin(); it != hudElements_.end(); ++it)94 for (std::set< SmartPtr<OrxonoxOverlay> >::iterator it = hudElements_.begin(); it != hudElements_.end(); ++it) 94 95 (*it)->scroll(scroll - this->scroll_); 95 96 this->scroll_ = scroll; … … 104 105 void OverlayGroup::addElement(OrxonoxOverlay* element) 105 106 { 106 hudElements_.insert( element);107 element->set Visible(this->isVisible());107 hudElements_.insert(SmartPtr<OrxonoxOverlay>(element)); 108 element->setOverlayGroup( this ); 108 109 if (this->owner_) 109 110 element->setOwner(this->owner_); … … 120 121 bool OverlayGroup::removeElement(OrxonoxOverlay* element) 121 122 { 122 if(this->hudElements_.erase( element) == 0)123 if(this->hudElements_.erase(SmartPtr<OrxonoxOverlay>(element)) == 0) 123 124 return false; 124 125 return true; … … 130 131 if (index < this->hudElements_.size()) 131 132 { 132 std::set< OrxonoxOverlay*>::const_iterator it = hudElements_.begin();133 std::set< SmartPtr<OrxonoxOverlay> >::const_iterator it = hudElements_.begin(); 133 134 for (unsigned int i = 0; i != index; ++it, ++i) 134 135 ; 135 return (*it);136 return it->get(); 136 137 } 137 138 else … … 142 143 void OverlayGroup::changedVisibility() 143 144 { 144 for (std::set<OrxonoxOverlay*>::iterator it = hudElements_.begin(); it != hudElements_.end(); ++it) 145 (*it)->setVisible(this->isVisible()); 145 SUPER( OverlayGroup, changedVisibility ); 146 147 for (std::set< SmartPtr<OrxonoxOverlay> >::iterator it = hudElements_.begin(); it != hudElements_.end(); ++it) 148 (*it)->changedVisibility(); //inform all Child Overlays that our visibility has changed 146 149 } 147 150 … … 150 153 this->owner_ = owner; 151 154 152 for (std::set< OrxonoxOverlay*>::iterator it = hudElements_.begin(); it != hudElements_.end(); ++it)155 for (std::set< SmartPtr<OrxonoxOverlay> >::iterator it = hudElements_.begin(); it != hudElements_.end(); ++it) 153 156 (*it)->setOwner(owner); 154 157 }
Note: See TracChangeset
for help on using the changeset viewer.