Changeset 13041 for OpenSceneGraph/trunk/include/osgParticle/ModularProgram
- Timestamp:
- 03/21/12 18:36:20 (14 months ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
OpenSceneGraph/trunk/include/osgParticle/ModularProgram
r5328 r13041 1 /* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield 1 /* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield 2 2 * 3 * This library is open source and may be redistributed and/or modified under 4 * the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or 3 * This library is open source and may be redistributed and/or modified under 4 * the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or 5 5 * (at your option) any later version. The full license is in LICENSE file 6 6 * included with this distribution, and on the openscenegraph.org website. 7 * 7 * 8 8 * This library is distributed in the hope that it will be useful, 9 9 * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 11 * OpenSceneGraph Public License for more details. 12 12 */ … … 29 29 30 30 /** A program class for performing operations on particles using a sequence of <I>operators</I>. 31 To use a <CODE>ModularProgram</CODE> you have to create some <CODE>Operator</CODE> objects and 31 To use a <CODE>ModularProgram</CODE> you have to create some <CODE>Operator</CODE> objects and 32 32 add them to the program. 33 33 All operators will be applied to each particle in the same order they've been added to the program. 34 */ 34 */ 35 35 class OSGPARTICLE_EXPORT ModularProgram: public Program { 36 36 public: 37 37 ModularProgram(); 38 38 ModularProgram(const ModularProgram& copy, const osg::CopyOp& copyop = osg::CopyOp::SHALLOW_COPY); 39 39 40 40 META_Node(osgParticle,ModularProgram); 41 41 42 42 /// Get the number of operators. 43 43 inline int numOperators() const; 44 45 /// Add an operator to the list. 44 45 /// Add an operator to the list. 46 46 inline void addOperator(Operator* o); 47 47 48 48 /// Get a pointer to an operator in the list. 49 49 inline Operator* getOperator(int i); 50 50 51 51 /// Get a const pointer to an operator in the list. 52 52 inline const Operator* getOperator(int i) const; 53 53 54 54 /// Remove an operator from the list. 55 inline void removeOperator(int i); 56 55 inline void removeOperator(int i); 56 57 57 protected: 58 58 virtual ~ModularProgram() {} 59 59 ModularProgram& operator=(const ModularProgram&) { return *this; } 60 60 61 61 void execute(double dt); 62 62 63 63 private: 64 64 typedef std::vector<osg::ref_ptr<Operator> > Operator_vector; … … 66 66 Operator_vector _operators; 67 67 }; 68 68 69 69 // INLINE FUNCTIONS 70 70 71 71 inline int ModularProgram::numOperators() const 72 72 { … … 93 93 _operators.erase(_operators.begin()+i); 94 94 } 95 95 96 96 97 97 }
