BALL  1.5.0
representationManager.h
Go to the documentation of this file.
1 // -*- Mode: C++; tab-width: 2; -*-
2 // vi: set ts=2:
3 //
4 // $Id: representationManager.h,v 1.1.4.2 2007/03/28 13:11:43 amoll Exp $
5 
6 #ifndef BALL_VIEW_KERNEL_REPRESENTATIONMANAGER_H
7 #define BALL_VIEW_KERNEL_REPRESENTATIONMANAGER_H
8 
9 #ifndef BALL_VIEW_KERNEL_REPRESENTATION_H
11 #endif
12 
13 #ifndef BALL_SYSTEM_MUTEX_H
14 #include <BALL/SYSTEM/mutex.h>
15 #endif
16 
17 #include <QtCore/QCoreApplication>
18 #include <QtCore/QWaitCondition>
19 
20 #include <vector>
21 
22 using std::vector;
23 
24 namespace BALL
25 {
26  class Composite;
27  class INIFile;
28 
29  namespace VIEW
30  {
31  class MainControl;
32  class UpdateRepresentationThread;
33  class ClippingPlane;
34 
46  : public Object
47  {
48  friend class Representation;
50  friend class BALLThread;
51  friend class MainControl;
52 
53  public:
54 
56 
57 
63 
65  typedef RepresentationList::iterator RepresentationsIterator;
66 
68  typedef RepresentationList::const_iterator RepresentationsConstIterator;
69 
71 
74 
79 
83 
87 
89 
92 
94  const RepresentationManager& operator = (const RepresentationManager& pm);
95 
97  bool operator == (const RepresentationManager& pm) const;
98 
100  void clear();
101 
108  bool remove(Representation& representation, bool send_message = true);
109 
114  bool insert(Representation& representation, bool send_message = true);
115 
118  { return representations_;}
119 
122  { return representations_.size();}
123 
126 
128  bool has(const Representation& representation) const;
129 
131  void dump(std::ostream& s, Size depth = 0) const;
132 
135  { return representations_.begin();}
136 
139  { return representations_.begin();}
140 
143  { return representations_.end();}
144 
147  { return representations_.end();}
148 
156  RepresentationList removedComposite(const Composite& composite, bool update = true);
157 
163 
166 
168  const vector<ClippingPlane*>& getClippingPlanes() const { return clipping_planes_;}
169 
172 
175 
178 
180  void restoreRepresentations(const INIFile& in, const vector<const Composite*>& new_systems);
181 
184 
186  bool willBeUpdated(const Representation& rep) const;
187 
189  bool updateRunning() const ;
190 
193 
196 
198  bool isBeeingRendered(const Representation* rep) const;
199 
200  protected:
201 
204 
206 
207  /*_ Called by Representation::update() to start a multithreaded
208  Update of the Representation.
209  (Only used in Multithreaded code.)
210  */
212 
213  //_ List with all representations
215 
219 
220  vector<ClippingPlane*> clipping_planes_;
221 
222  // we need to ensure that the mutex is always created correctly before
223  // the thread that tries to access it!
225 
229 
231  };
232 
233  } // namespace VIEW
234 } // namespace BALL
235 
236 #endif // BALL_VIEW_KERNEL_REPRESENTATIONMANAGER_H
BALL::VIEW::RepresentationManager::RepresentationsConstIterator
RepresentationList::const_iterator RepresentationsConstIterator
ConstIterator to the Representations.
Definition: representationManager.h:68
BALL::VIEW::RepresentationManager::still_to_notify_
bool still_to_notify_
Definition: representationManager.h:228
BALL::VIEW::RepresentationManager::update_
void update_(Representation &rep)
BALL::VIEW::RepresentationList
std::list< Representation * > RepresentationList
Definition: representation.h:342
BALL::VIEW::RepresentationManager::rebuildAllRepresentations
void rebuildAllRepresentations()
BALL::VIEW::RepresentationManager
Definition: representationManager.h:47
BALL::VIEW::RepresentationManager::thread_
UpdateRepresentationThread * thread_
Definition: representationManager.h:226
BALL::VIEW::RepresentationManager::getClippingPlanes
const vector< ClippingPlane * > & getClippingPlanes() const
Definition: representationManager.h:168
BALL::VIEW::Representation
Definition: representation.h:59
BALL::VIEW::RepresentationManager::updateRunning
bool updateRunning() const
Return true, if a Representation is currently beeing updated.
BALL::Object
Definition: object.h:36
BALL::VIEW::MainControl
Definition: mainControl.h:118
representation.h
BALL::VIEW::RepresentationManager::getNumberOfRepresentations
Size getNumberOfRepresentations() const
Get the number of the Representations.
Definition: representationManager.h:121
BALL::VIEW::RepresentationManager::isBeeingRendered
bool isBeeingRendered(const Representation *rep) const
Used by UpdateRepresentationThread.
BALL
Definition: constants.h:13
BALL::VIEW::BALLThread
Definition: threads.h:72
BALL::VIEW::RepresentationManager::remove
bool remove(Representation &representation, bool send_message=true)
BALL::HashSet
Definition: hashSet.h:46
BALL::VIEW::RepresentationManager::RepresentationManager
RepresentationManager(MainControl *mc=0)
BALL::VIEW::RepresentationManager::beeing_rendered_
HashSet< Representation * > beeing_rendered_
Definition: representationManager.h:216
BALL::VIEW::RepresentationManager::has
bool has(const Representation &representation) const
Test if a Representation is inserted.
BALL::VIEW::RepresentationManager::focusRepresentation
void focusRepresentation(const Representation &rep)
BALL::VIEW::RepresentationManager::restoreRepresentations
void restoreRepresentations(const INIFile &in, const vector< const Composite * > &new_systems)
BALL::VIEW::RepresentationManager::clipping_planes_
vector< ClippingPlane * > clipping_planes_
Definition: representationManager.h:220
BALL::VIEW::RepresentationManager::storeRepresentations
void storeRepresentations(INIFile &out)
BALL::VIEW::RepresentationManager::RepresentationManager
RepresentationManager(const RepresentationManager &pm)
BALL::Composite
Definition: composite.h:74
BALL::VIEW::RepresentationManager::removedComposite
RepresentationList removedComposite(const Composite &composite, bool update=true)
BALL_SIZE_TYPE
BALL_VIEW_EXPORT
#define BALL_VIEW_EXPORT
Definition: COMMON/global.h:52
BALL::VIEW::RepresentationManager::clear
void clear()
Clears also the representations.
BALL::INIFile
Definition: INIFile.h:29
BALL::VIEW::RepresentationManager::insertClippingPlane
void insertClippingPlane(ClippingPlane *plane)
BALL::VIEW::RepresentationManager::main_control_
MainControl * main_control_
Definition: representationManager.h:230
BALL::VIEW::RepresentationManager::RepresentationsIterator
RepresentationList::iterator RepresentationsIterator
Iteration to the Representations.
Definition: representationManager.h:65
mutex.h
BALL::VIEW::RepresentationManager::~RepresentationManager
virtual ~RepresentationManager()
BALL::VIEW::RepresentationManager::end
RepresentationsConstIterator end() const
Const Iterator pointing behind the last Representation.
Definition: representationManager.h:146
BALL::VIEW::RepresentationManager::finishedRendering
void finishedRendering(Representation *rep)
BALL::operator==
BALL_EXPORT bool operator==(const String &s1, const String &s2)
BALL::VIEW::RepresentationManager::getRepresentationsOf
RepresentationList getRepresentationsOf(const Composite &composite)
BALL::VIEW::UpdateRepresentationThread
Definition: threads.h:161
BALL::VIEW::RepresentationManager::insert
bool insert(Representation &representation, bool send_message=true)
BALL::VIEW::ClippingPlane
Definition: clippingPlane.h:26
BALL::VIEW::RepresentationManager::popRepresentationToUpdate
Representation * popRepresentationToUpdate()
BALL::VIEW::RepresentationManager::removeClippingPlane
bool removeClippingPlane(ClippingPlane *plane)
BALL::VIEW::RepresentationManager::createRepresentation
Representation * createRepresentation()
Create a Representation and insert it.
BALL::VIEW::RepresentationManager::update_mutex_
Mutex update_mutex_
Definition: representationManager.h:224
BALL_CREATE
#define BALL_CREATE(name)
Definition: create.h:62
BALL::VIEW::RepresentationManager::beeing_updated_
HashSet< Representation * > beeing_updated_
Definition: representationManager.h:217
BALL::VIEW::RepresentationManager::finishedUpdate_
void finishedUpdate_(Representation *rep)
BALL::VIEW::RepresentationManager::willBeUpdated
bool willBeUpdated(const Representation &rep) const
Return true if a Representation will be updated.
BALL::VIEW::RepresentationManager::representations_
RepresentationList representations_
Definition: representationManager.h:214
BALL::VIEW::RepresentationManager::startRendering
bool startRendering(Representation *rep)
BALL::VIEW::RepresentationManager::begin
RepresentationsIterator begin()
Iterator to the first Representation.
Definition: representationManager.h:134
BALL::TMutex< BALL_DEFAULT_MUTEX_TYPE >
BALL::VIEW::RepresentationManager::begin
RepresentationsConstIterator begin() const
ConstIterator to the first Representation.
Definition: representationManager.h:138
BALL::VIEW::RepresentationManager::dump
void dump(std::ostream &s, Size depth=0) const
Dump the internal state to an output stream.
BALL::VIEW::RepresentationManager::no_update_
bool no_update_
Definition: representationManager.h:227
BALL::VIEW::RepresentationManager::getRepresentations
const RepresentationList & getRepresentations() const
Get the list with the Representations.
Definition: representationManager.h:117
BALL::VIEW::RepresentationManager::end
RepresentationsIterator end()
Iterator pointing behind the last Representation.
Definition: representationManager.h:142
BALL::VIEW::RepresentationManager::to_update_
HashSet< Representation * > to_update_
Definition: representationManager.h:218