collection operator +

This commit is contained in:
David Rose 2008-11-10 23:54:45 +00:00
parent 26d832b486
commit fbc38a3e01
18 changed files with 230 additions and 3 deletions

View File

@ -21,3 +21,26 @@
INLINE AsyncTaskCollection::
~AsyncTaskCollection() {
}
////////////////////////////////////////////////////////////////////
// Function: AsyncTaskCollection::operator +=
// Access: Published
// Description: Appends the other list onto the end of this one.
////////////////////////////////////////////////////////////////////
INLINE void AsyncTaskCollection::
operator += (const AsyncTaskCollection &other) {
add_tasks_from(other);
}
////////////////////////////////////////////////////////////////////
// Function: AsyncTaskCollection::operator +
// Access: Published
// Description: Returns a AsyncTaskCollection representing the
// concatenation of the two lists.
////////////////////////////////////////////////////////////////////
INLINE AsyncTaskCollection AsyncTaskCollection::
operator + (const AsyncTaskCollection &other) const {
AsyncTaskCollection a(*this);
a += other;
return a;
}

View File

@ -50,6 +50,8 @@ PUBLISHED:
void remove_task(int index);
AsyncTask *operator [] (int index) const;
int size() const;
INLINE void operator += (const AsyncTaskCollection &other);
INLINE AsyncTaskCollection operator + (const AsyncTaskCollection &other) const;
void output(ostream &out) const;
void write(ostream &out, int indent_level = 0) const;

View File

@ -38,7 +38,7 @@
odePlane2dJoint.I odePlane2dJoint.h \
odeSliderJoint.I odeSliderJoint.h \
odeUniversalJoint.I odeUniversalJoint.h \
odeJointCollection.h \
odeJointCollection.I odeJointCollection.h \
odeSimpleSpace.I odeSimpleSpace.h \
odeHashSpace.I odeHashSpace.h \
odeQuadTreeSpace.I odeQuadTreeSpace.h \
@ -99,7 +99,7 @@
odePlane2dJoint.I odePlane2dJoint.h \
odeSliderJoint.I odeSliderJoint.h \
odeUniversalJoint.I odeUniversalJoint.h \
odeJointCollection.h \
odeJointCollection.I odeJointCollection.h \
odeSimpleSpace.I odeSimpleSpace.h \
odeHashSpace.I odeHashSpace.h \
odeQuadTreeSpace.I odeQuadTreeSpace.h \

View File

@ -0,0 +1,46 @@
// Filename: odeJointCollection.I
// Created by: drose (10Nov08)
//
////////////////////////////////////////////////////////////////////
//
// PANDA 3D SOFTWARE
// Copyright (c) Carnegie Mellon University. All rights reserved.
//
// All use of this software is subject to the terms of the revised BSD
// license. You should have received a copy of this license along
// with this source code in a file named "LICENSE."
//
////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////
// Function: OdeJointCollection::Destructor
// Access: Published
// Description:
////////////////////////////////////////////////////////////////////
INLINE OdeJointCollection::
~OdeJointCollection() {
}
////////////////////////////////////////////////////////////////////
// Function: OdeJointCollection::operator +=
// Access: Published
// Description: Appends the other list onto the end of this one.
////////////////////////////////////////////////////////////////////
INLINE void OdeJointCollection::
operator += (const OdeJointCollection &other) {
add_joints_from(other);
}
////////////////////////////////////////////////////////////////////
// Function: OdeJointCollection::operator +
// Access: Published
// Description: Returns a OdeJointCollection representing the
// concatenation of the two lists.
////////////////////////////////////////////////////////////////////
INLINE OdeJointCollection OdeJointCollection::
operator + (const OdeJointCollection &other) const {
OdeJointCollection a(*this);
a += other;
return a;
}

View File

@ -26,7 +26,7 @@ PUBLISHED:
OdeJointCollection();
OdeJointCollection(const OdeJointCollection &copy);
void operator = (const OdeJointCollection &copy);
INLINE ~OdeJointCollection() {};
INLINE ~OdeJointCollection();
void add_joint(const OdeJoint &joint);
bool remove_joint(const OdeJoint &joint);
@ -42,10 +42,14 @@ PUBLISHED:
MAKE_SEQ(get_joints, get_num_joints, get_joint);
OdeJoint operator [] (int index) const;
int size() const;
INLINE void operator += (const OdeJointCollection &other);
INLINE OdeJointCollection operator + (const OdeJointCollection &other) const;
private:
typedef PTA(OdeJoint) Joints;
Joints _joints;
};
#include "odeJointCollection.I"
#endif

View File

@ -54,12 +54,14 @@ PUBLISHED:
INLINE int get_num_curves() const;
INLINE ParametricCurve *get_curve(int index) const;
MAKE_SEQ(get_curves, get_num_curves, get_curve);
ParametricCurve *get_xyz_curve() const;
ParametricCurve *get_hpr_curve() const;
ParametricCurve *get_default_curve() const;
int get_num_timewarps() const;
ParametricCurve *get_timewarp_curve(int n) const;
MAKE_SEQ(get_timewarp_curves, get_num_timewarps, get_timewarp_curve);
INLINE float get_max_t() const;

View File

@ -21,3 +21,26 @@
INLINE InternalNameCollection::
~InternalNameCollection() {
}
////////////////////////////////////////////////////////////////////
// Function: InternalNameCollection::operator +=
// Access: Published
// Description: Appends the other list onto the end of this one.
////////////////////////////////////////////////////////////////////
INLINE void InternalNameCollection::
operator += (const InternalNameCollection &other) {
add_names_from(other);
}
////////////////////////////////////////////////////////////////////
// Function: InternalNameCollection::operator +
// Access: Published
// Description: Returns a InternalNameCollection representing the
// concatenation of the two lists.
////////////////////////////////////////////////////////////////////
INLINE InternalNameCollection InternalNameCollection::
operator + (const InternalNameCollection &other) const {
InternalNameCollection a(*this);
a += other;
return a;
}

View File

@ -43,6 +43,8 @@ PUBLISHED:
MAKE_SEQ(get_names, get_num_names, get_name);
InternalName *operator [] (int index) const;
int size() const;
INLINE void operator += (const InternalNameCollection &other);
INLINE InternalNameCollection operator + (const InternalNameCollection &other) const;
void output(ostream &out) const;
void write(ostream &out, int indent_level = 0) const;

View File

@ -21,3 +21,26 @@
INLINE MaterialCollection::
~MaterialCollection() {
}
////////////////////////////////////////////////////////////////////
// Function: MaterialCollection::operator +=
// Access: Published
// Description: Appends the other list onto the end of this one.
////////////////////////////////////////////////////////////////////
INLINE void MaterialCollection::
operator += (const MaterialCollection &other) {
add_materials_from(other);
}
////////////////////////////////////////////////////////////////////
// Function: MaterialCollection::operator +
// Access: Published
// Description: Returns a MaterialCollection representing the
// concatenation of the two lists.
////////////////////////////////////////////////////////////////////
INLINE MaterialCollection MaterialCollection::
operator + (const MaterialCollection &other) const {
MaterialCollection a(*this);
a += other;
return a;
}

View File

@ -44,6 +44,8 @@ PUBLISHED:
Material *get_material(int index) const;
Material *operator [] (int index) const;
int size() const;
INLINE void operator += (const MaterialCollection &other);
INLINE MaterialCollection operator + (const MaterialCollection &other) const;
void output(ostream &out) const;
void write(ostream &out, int indent_level = 0) const;

View File

@ -22,6 +22,29 @@ INLINE NodePathCollection::
~NodePathCollection() {
}
////////////////////////////////////////////////////////////////////
// Function: NodePathCollection::operator +=
// Access: Published
// Description: Appends the other list onto the end of this one.
////////////////////////////////////////////////////////////////////
INLINE void NodePathCollection::
operator += (const NodePathCollection &other) {
add_paths_from(other);
}
////////////////////////////////////////////////////////////////////
// Function: NodePathCollection::operator +
// Access: Published
// Description: Returns a NodePathCollection representing the
// concatenation of the two lists.
////////////////////////////////////////////////////////////////////
INLINE NodePathCollection NodePathCollection::
operator + (const NodePathCollection &other) const {
NodePathCollection a(*this);
a += other;
return a;
}
////////////////////////////////////////////////////////////////////
// Function: NodePathCollection::ls
// Access: Published

View File

@ -47,6 +47,8 @@ PUBLISHED:
MAKE_SEQ(get_paths, get_num_paths, get_path);
NodePath operator [] (int index) const;
int size() const;
INLINE void operator += (const NodePathCollection &other);
INLINE NodePathCollection operator + (const NodePathCollection &other) const;
// Handy operations on many NodePaths at once.
INLINE void ls() const;

View File

@ -21,3 +21,26 @@
INLINE TextureCollection::
~TextureCollection() {
}
////////////////////////////////////////////////////////////////////
// Function: TextureCollection::operator +=
// Access: Published
// Description: Appends the other list onto the end of this one.
////////////////////////////////////////////////////////////////////
INLINE void TextureCollection::
operator += (const TextureCollection &other) {
add_textures_from(other);
}
////////////////////////////////////////////////////////////////////
// Function: TextureCollection::operator +
// Access: Published
// Description: Returns a TextureCollection representing the
// concatenation of the two lists.
////////////////////////////////////////////////////////////////////
INLINE TextureCollection TextureCollection::
operator + (const TextureCollection &other) const {
TextureCollection a(*this);
a += other;
return a;
}

View File

@ -45,6 +45,8 @@ PUBLISHED:
MAKE_SEQ(get_textures, get_num_textures, get_texture);
Texture *operator [] (int index) const;
int size() const;
INLINE void operator += (const TextureCollection &other);
INLINE TextureCollection operator + (const TextureCollection &other) const;
void output(ostream &out) const;
void write(ostream &out, int indent_level = 0) const;

View File

@ -21,3 +21,26 @@
INLINE TextureStageCollection::
~TextureStageCollection() {
}
////////////////////////////////////////////////////////////////////
// Function: TextureStageCollection::operator +=
// Access: Published
// Description: Appends the other list onto the end of this one.
////////////////////////////////////////////////////////////////////
INLINE void TextureStageCollection::
operator += (const TextureStageCollection &other) {
add_texture_stages_from(other);
}
////////////////////////////////////////////////////////////////////
// Function: TextureStageCollection::operator +
// Access: Published
// Description: Returns a TextureStageCollection representing the
// concatenation of the two lists.
////////////////////////////////////////////////////////////////////
INLINE TextureStageCollection TextureStageCollection::
operator + (const TextureStageCollection &other) const {
TextureStageCollection a(*this);
a += other;
return a;
}

View File

@ -45,6 +45,8 @@ PUBLISHED:
MAKE_SEQ(get_texture_stages, get_num_texture_stages, get_texture_stage);
TextureStage *operator [] (int index) const;
int size() const;
INLINE void operator += (const TextureStageCollection &other);
INLINE TextureStageCollection operator + (const TextureStageCollection &other) const;
void sort();

View File

@ -12,6 +12,7 @@
//
////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////
// Function: PhysicsObjectCollection::Destructor
// Access: Published
@ -21,3 +22,25 @@ INLINE PhysicsObjectCollection::
~PhysicsObjectCollection() {
}
////////////////////////////////////////////////////////////////////
// Function: PhysicsObjectCollection::operator +=
// Access: Published
// Description: Appends the other list onto the end of this one.
////////////////////////////////////////////////////////////////////
INLINE void PhysicsObjectCollection::
operator += (const PhysicsObjectCollection &other) {
add_physics_objects_from(other);
}
////////////////////////////////////////////////////////////////////
// Function: PhysicsObjectCollection::operator +
// Access: Published
// Description: Returns a PhysicsObjectCollection representing the
// concatenation of the two lists.
////////////////////////////////////////////////////////////////////
INLINE PhysicsObjectCollection PhysicsObjectCollection::
operator + (const PhysicsObjectCollection &other) const {
PhysicsObjectCollection a(*this);
a += other;
return a;
}

View File

@ -46,6 +46,8 @@ PUBLISHED:
MAKE_SEQ(get_physics_objects, get_num_physics_objects, get_physics_object);
PT(PhysicsObject) operator [] (int index) const;
int size() const;
INLINE void operator += (const PhysicsObjectCollection &other);
INLINE PhysicsObjectCollection operator + (const PhysicsObjectCollection &other) const;
void output(ostream &out) const;
void write(ostream &out, int indent_level = 0) const;