mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-03 10:22:45 -04:00
better output methods
This commit is contained in:
parent
63904c687e
commit
6dfe2d4a49
@ -362,6 +362,18 @@ get_part() const {
|
||||
return DCAST(PartBundle, _part);
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
// Function: AnimControl::output
|
||||
// Access: Published
|
||||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
void AnimControl::
|
||||
output(ostream &out) const {
|
||||
out << "AnimControl(" << get_part()->get_name()
|
||||
<< ", " << get_anim()->get_name() << ")";
|
||||
}
|
||||
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
// Function: AnimControl::advance_time
|
||||
@ -457,18 +469,6 @@ mark_channels() {
|
||||
_marked_frame = get_frame();
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
// Function: AnimControl::output
|
||||
// Access: Public
|
||||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
void AnimControl::
|
||||
output(ostream &out) const {
|
||||
out << "AnimControl(" << get_part()->get_name()
|
||||
<< ", " << get_anim()->get_name() << ")";
|
||||
}
|
||||
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
// Function: AnimControl::insert_event_action
|
||||
|
@ -74,6 +74,8 @@ PUBLISHED:
|
||||
PartBundle *get_part() const;
|
||||
INLINE AnimBundle *get_anim() const;
|
||||
|
||||
void output(ostream &out) const;
|
||||
|
||||
public:
|
||||
// The following functions aren't really part of the public
|
||||
// interface; they're just public so we don't have to declare a
|
||||
@ -86,8 +88,6 @@ public:
|
||||
|
||||
INLINE int get_channel_index() const;
|
||||
|
||||
void output(ostream &out) const;
|
||||
|
||||
private:
|
||||
|
||||
enum ActionType {
|
||||
|
@ -239,3 +239,10 @@ get_num_frames(const string &anim_name) const {
|
||||
}
|
||||
return control->get_num_frames();
|
||||
}
|
||||
|
||||
INLINE ostream &
|
||||
operator << (ostream &out, const AnimControlCollection &collection) {
|
||||
collection.output(out);
|
||||
return out;
|
||||
}
|
||||
|
||||
|
@ -229,3 +229,26 @@ which_anim_playing() const {
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
// Function: AnimControlCollection::output
|
||||
// Access: Published
|
||||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
void AnimControlCollection::
|
||||
output(ostream &out) const {
|
||||
out << _controls.size() << " anims.";
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
// Function: AnimControlCollection::write
|
||||
// Access: Published
|
||||
// Description:
|
||||
////////////////////////////////////////////////////////////////////
|
||||
void AnimControlCollection::
|
||||
write(ostream &out) const {
|
||||
Controls::const_iterator ci;
|
||||
for (ci = _controls.begin(); ci != _controls.end(); ++ci) {
|
||||
out << (*ci).first << ": " << *(*ci).second << "\n";
|
||||
}
|
||||
}
|
||||
|
@ -23,10 +23,9 @@
|
||||
|
||||
#include "animControl.h"
|
||||
|
||||
#include <event.h>
|
||||
#include <pt_Event.h>
|
||||
#include "event.h"
|
||||
#include "pt_Event.h"
|
||||
|
||||
#include <string>
|
||||
#include "pmap.h"
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
@ -84,6 +83,9 @@ PUBLISHED:
|
||||
|
||||
string which_anim_playing() const;
|
||||
|
||||
void output(ostream &out) const;
|
||||
void write(ostream &out) const;
|
||||
|
||||
private:
|
||||
typedef pmap<string, PT(AnimControl) > Controls;
|
||||
Controls _controls;
|
||||
@ -91,6 +93,8 @@ private:
|
||||
AnimControl *_last_started_control;
|
||||
};
|
||||
|
||||
INLINE ostream &operator << (ostream &out, const AnimControlCollection &collection);
|
||||
|
||||
#include "animControlCollection.I"
|
||||
|
||||
#endif
|
||||
|
Loading…
x
Reference in New Issue
Block a user