Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

OSGParticles.inl

Go to the documentation of this file.
00001 /*---------------------------------------------------------------------------*\
00002  *                                OpenSG                                     *
00003  *                                                                           *
00004  *                                                                           *
00005  *                     Copyright 2000-2002 by OpenSG Forum                   *
00006  *                                                                           *
00007  *   contact: dirk@opensg.org, gerrit.voss@vossg.org, jbehr@zgdv.de          *
00008  *                                                                           *
00009 \*---------------------------------------------------------------------------*/
00010 /*---------------------------------------------------------------------------*\
00011  *                                License                                    *
00012  *                                                                           *
00013  * This library is free software; you can redistribute it and/or modify it   *
00014  * under the terms of the GNU Library General Public License as published    *
00015  * by the Free Software Foundation, version 2.                               *
00016  *                                                                           *
00017  * This library is distributed in the hope that it will be useful, but       *
00018  * WITHOUT ANY WARRANTY; without even the implied warranty of                *
00019  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU         *
00020  * Library General Public License for more details.                          *
00021  *                                                                           *
00022  * You should have received a copy of the GNU Library General Public         *
00023  * License along with this library; if not, write to the Free Software       *
00024  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.                 *
00025  *                                                                           *
00026 \*---------------------------------------------------------------------------*/
00027 /*---------------------------------------------------------------------------*\
00028  *                                Changes                                    *
00029  *                                                                           *
00030  *                                                                           *
00031  *                                                                           *
00032  *                                                                           *
00033  *                                                                           *
00034  *                                                                           *
00035 \*---------------------------------------------------------------------------*/
00036 
00037 //---------------------------------------------------------------------------
00038 //  Includes
00039 //---------------------------------------------------------------------------
00040 
00041 #include <OSGConfig.h>
00042 
00043 OSG_BEGIN_NAMESPACE
00044 
00045 /*------------------------------ access -----------------------------------*/
00046 
00047 inline
00048 void Particles::setPositions(const GeoPositionsPtr &value)
00049 {
00050     ParticlesPtr thisP(*this);
00051 
00052     addRefCP(value);
00053 
00054     if(_sfPositions.getValue() != NullFC)
00055     {
00056         beginEditCP(_sfPositions.getValue(), Attachment::ParentsFieldMask);
00057         {
00058             _sfPositions.getValue()->subParent(thisP);
00059         }
00060         endEditCP  (_sfPositions.getValue(), Attachment::ParentsFieldMask);
00061 
00062         subRefCP(_sfPositions.getValue());
00063     }
00064 
00065     if(value != NullFC)
00066     {
00067         thisP.setParentFieldPos(PositionsFieldId);
00068 
00069         beginEditCP(value, Attachment::ParentsFieldMask);
00070         {
00071             value->addParent(thisP);
00072         }
00073         endEditCP  (value, Attachment::ParentsFieldMask);
00074     }
00075 
00076     _sfPositions.setValue(value);
00077 }
00078 
00079 inline
00080 void Particles::setSecPositions(const GeoPositionsPtr &value)
00081 {
00082     ParticlesPtr thisP(*this);
00083 
00084     addRefCP(value);
00085 
00086     if(_sfSecPositions.getValue() != NullFC)
00087     {
00088         beginEditCP(_sfSecPositions.getValue(), Attachment::ParentsFieldMask);
00089         {
00090             _sfSecPositions.getValue()->subParent(thisP);
00091         }
00092         endEditCP  (_sfSecPositions.getValue(), Attachment::ParentsFieldMask);
00093 
00094         subRefCP(_sfSecPositions.getValue());
00095     }
00096 
00097     if(value != NullFC)
00098     {
00099         thisP.setParentFieldPos(SecPositionsFieldId);
00100 
00101         beginEditCP(value, Attachment::ParentsFieldMask);
00102         {
00103             value->addParent(thisP);
00104         }
00105         endEditCP  (value, Attachment::ParentsFieldMask);
00106     }
00107 
00108     _sfSecPositions.setValue(value);
00109 }
00110 
00111 inline
00112 void Particles::setColors(const GeoColorsPtr &value)
00113 {
00114     ParticlesPtr thisP(*this);
00115 
00116     addRefCP(value);
00117 
00118     if(_sfColors.getValue() != NullFC)
00119     {
00120         beginEditCP(_sfColors.getValue(), Attachment::ParentsFieldMask);
00121         {
00122             _sfColors.getValue()->subParent(thisP);
00123         }
00124         endEditCP  (_sfColors.getValue(), Attachment::ParentsFieldMask);
00125 
00126         subRefCP(_sfColors.getValue());
00127     }
00128 
00129     if(value != NullFC)
00130     {
00131         thisP.setParentFieldPos(ColorsFieldId);
00132 
00133         beginEditCP(value, Attachment::ParentsFieldMask);
00134         {
00135             value->addParent(thisP);
00136         }
00137         endEditCP  (value, Attachment::ParentsFieldMask);
00138     }
00139 
00140     _sfColors.setValue(value);
00141 }
00142 
00143 inline
00144 void Particles::setNormals(const GeoNormalsPtr &value)
00145 {
00146     ParticlesPtr thisP(*this);
00147 
00148     addRefCP(value);
00149 
00150     if(_sfNormals.getValue() != NullFC)
00151     {
00152         beginEditCP(_sfNormals.getValue(), Attachment::ParentsFieldMask);
00153         {
00154             _sfNormals.getValue()->subParent(thisP);
00155         }
00156         endEditCP  (_sfNormals.getValue(), Attachment::ParentsFieldMask);
00157 
00158         subRefCP(_sfNormals.getValue());
00159     }
00160 
00161     if(value != NullFC)
00162     {
00163         thisP.setParentFieldPos(NormalsFieldId);
00164 
00165         beginEditCP(value, Attachment::ParentsFieldMask);
00166         {
00167             value->addParent(thisP);
00168         }
00169         endEditCP  (value, Attachment::ParentsFieldMask);
00170     }
00171 
00172     _sfNormals.setValue(value);
00173 }
00174 
00175 inline
00176 void Particles::setMaterial(const MaterialPtr &value)
00177 {
00178     setRefdCP(_sfMaterial.getValue(), value);
00179 }
00180 
00181 OSG_END_NAMESPACE
00182 
00183 #define OSGPARTICLES_INLINE_CVSID "@(#)$Id: OSGParticles.inl,v 1.1 2002/01/04 17:05:03 dirk Exp $"
00184 

Generated on Thu Aug 25 04:08:02 2005 for OpenSG by  doxygen 1.4.3