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

OSGGeoPropertyInterface.h

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 #ifndef _OSGGEOPROPERTYINTERFACES_H_
00039 #define _OSGGEOPROPERTYINTERFACES_H_
00040 #ifdef __sgi
00041 #pragma once
00042 #endif
00043 
00044 #include <OSGSystemDef.h>
00045 #include <OSGMFVecTypes.h>
00046 #include <OSGMFSysTypes.h>
00047 #include <OSGAttachment.h>
00048 #include <OSGAttachmentFieldDataType.h>
00049 
00050 OSG_BEGIN_NAMESPACE
00051 
00052 #ifndef OSG_SUPPORT_NO_GEO_INTERFACE
00053 
00070 class GeoPropertyArrayInterface
00071 {
00072     /*==========================  PUBLIC  =================================*/
00073   public:
00074 
00075     /*---------------------------------------------------------------------*/
00079     virtual UInt32  getFormat    (void) const = 0;
00080     virtual UInt32  getFormatSize(void) const = 0;
00081     virtual UInt32  getStride    (void) const = 0;
00082     virtual UInt32  getDimension (void) const = 0;
00083     virtual UInt32  getSize      (void) const = 0;
00084     virtual UInt32  size         (void) const = 0;
00085     virtual UInt8  *getData      (void) const = 0;
00086 
00088     /*---------------------------------------------------------------------*/
00092     virtual void  clear  (void          ) = 0;
00093     virtual void  resize (size_t newsize) = 0;
00094 
00096     /*---------------------------------------------------------------------*/
00100     GeoPropertyArrayInterface(void);
00101     GeoPropertyArrayInterface(const GeoPropertyArrayInterface &source);
00102 
00104     /*---------------------------------------------------------------------*/
00108     virtual ~GeoPropertyArrayInterface(void);
00109 
00111 };
00112 
00113 
00124 template <class GeoPropertyDesc>
00125 class GeoPropertyInterface : public GeoPropertyArrayInterface
00126 {
00127     /*==========================  PUBLIC  =================================*/
00128   public:
00129 
00130     typedef          GeoPropertyInterface<GeoPropertyDesc> InterfaceType;
00131 
00132     typedef typename GeoPropertyDesc::GenericType          GenericType;
00133 
00134     typedef          GeoPropertyArrayInterface          Inherited;
00135 
00136     /*---------------------------------------------------------------------*/
00140     virtual GenericType getValue (const UInt32       index )       = 0;
00141 
00142     virtual GenericType getValue (const UInt32       index ) const = 0;
00143 
00144     virtual void        getValue (      GenericType &val,
00145                                   const UInt32       index )       = 0;
00146 
00147     virtual void        getValue (      GenericType &val,
00148                                   const UInt32       index ) const = 0;
00149 
00150 
00151     virtual void        setValue (const GenericType &val,
00152                                   const UInt32       index )       = 0;
00153 
00154     virtual void        addValue (const GenericType &val   )       = 0;
00155 
00156 
00157     virtual void        push_back(const GenericType &val   )       = 0;
00158 
00160     /*---------------------------------------------------------------------*/
00164     GeoPropertyInterface(void);
00165     GeoPropertyInterface(const GeoPropertyInterface &source);
00166 
00168     /*---------------------------------------------------------------------*/
00172     virtual ~GeoPropertyInterface(void);
00173 
00175 };
00176 #endif
00177 
00178 
00183 struct AttachmentPropertyDesc
00184 {
00185     /*---------------------------------------------------------------------*/
00189     static const char *getTypeName (void)  { return "Attachment"; }
00190 
00192 };
00193 
00199 struct GeoPropertyDesc
00200 {
00201 };
00202 
00208 struct GeoPositionsPropertyDesc : public GeoPropertyDesc
00209 {
00210     /*---------------------------------------------------------------------*/
00214     static const Char8 *getTypeName (void) { return "GeoPositions";         }
00215 
00216     static const Char8 *getGroupName(void) { return "GeoPositions";         }
00217     static const Char8 *getClassName(void) { return "GeoPositionsProperty"; }
00218 
00219     static InitContainerF getInitMethod(void) { return NULL; }
00220 
00222     /*---------------------------------------------------------------------*/
00226     typedef Attachment             Inherited;
00227     typedef AttachmentPtr          InheritedPtr;
00228 
00229     typedef AttachmentPropertyDesc InheritedDesc;
00230 
00231     typedef Pnt3f                  GenericType;
00232 
00233 #ifndef OSG_SUPPORT_NO_GEO_INTERFACE
00234     typedef GeoPropertyInterface<GeoPositionsPropertyDesc> Interface;
00235 #endif
00236 
00238 };
00239 
00240 #ifndef OSG_SUPPORT_NO_GEO_INTERFACE
00241 typedef GeoPositionsPropertyDesc::Interface GeoPositionsInterface;
00242 #endif
00243 
00249 struct GeoNormalsPropertyDesc : public GeoPropertyDesc
00250 {
00251     /*---------------------------------------------------------------------*/
00255     static const Char8 *getTypeName (void) { return "GeoNormals";         }
00256     static const Char8 *getGroupName(void) { return "GeoNormals";         }
00257     static const Char8 *getClassName(void) { return "GeoNormalsProperty"; }
00258 
00259     static InitContainerF getInitMethod(void) { return NULL; }
00260 
00262     /*---------------------------------------------------------------------*/
00266     typedef Attachment             Inherited;
00267     typedef AttachmentPtr          InheritedPtr;
00268 
00269     typedef AttachmentPropertyDesc InheritedDesc;
00270 
00271     typedef Vec3f                  GenericType;
00272 
00273 #ifndef OSG_SUPPORT_NO_GEO_INTERFACE
00274     typedef GeoPropertyInterface<GeoNormalsPropertyDesc> Interface;
00275 #endif
00276 
00278 };
00279 
00280 #ifndef OSG_SUPPORT_NO_GEO_INTERFACE
00281 typedef GeoNormalsPropertyDesc::Interface GeoNormalsInterface;
00282 #endif
00283 
00289 struct GeoColorsPropertyDesc : public GeoPropertyDesc
00290 {
00291     /*---------------------------------------------------------------------*/
00295     static const Char8 *getTypeName (void) { return "GeoColors";         }
00296     static const Char8 *getGroupName(void) { return "GeoColors";         }
00297     static const Char8 *getClassName(void) { return "GeoColorsProperty"; }
00298 
00299     static InitContainerF getInitMethod(void) { return NULL; }
00300 
00302     /*---------------------------------------------------------------------*/
00306     typedef Attachment             Inherited;
00307     typedef AttachmentPtr          InheritedPtr;
00308 
00309     typedef AttachmentPropertyDesc InheritedDesc;
00310 
00311     typedef Color3f                GenericType;
00312 
00313 #ifndef OSG_SUPPORT_NO_GEO_INTERFACE
00314     typedef GeoPropertyInterface<GeoColorsPropertyDesc> Interface;
00315 #endif
00316 
00318 };
00319 
00320 #ifndef OSG_SUPPORT_NO_GEO_INTERFACE
00321 typedef GeoColorsPropertyDesc::Interface GeoColorsInterface;
00322 #endif
00323 
00329 struct GeoTexCoordsPropertyDesc : public GeoPropertyDesc
00330 {
00331     /*---------------------------------------------------------------------*/
00335     static const Char8 *getTypeName (void) { return "GeoTexCoords";         }
00336     static const Char8 *getGroupName(void) { return "GeoTexCoords";         }
00337     static const Char8 *getClassName(void) { return "GeoTexCoordsProperty"; }
00338 
00339     static InitContainerF getInitMethod(void) { return NULL; }
00340     
00342     /*---------------------------------------------------------------------*/
00346     typedef Attachment              Inherited;
00347     typedef AttachmentPtr           InheritedPtr;
00348 
00349     typedef AttachmentPropertyDesc  InheritedDesc;
00350 
00351     typedef Vec2f                   GenericType;
00352 
00353 #ifndef OSG_SUPPORT_NO_GEO_INTERFACE
00354     typedef GeoPropertyInterface<GeoTexCoordsPropertyDesc> Interface;
00355 #endif
00356 
00358 };
00359 
00360 #ifndef OSG_SUPPORT_NO_GEO_INTERFACE
00361 typedef GeoTexCoordsPropertyDesc::Interface GeoTexCoordsInterface;
00362 #endif
00363 
00369 struct GeoIndicesPropertyDesc : public GeoPropertyDesc
00370 {
00371     /*---------------------------------------------------------------------*/
00375     static const Char8 *getTypeName (void) { return "GeoIndices";         }
00376     static const Char8 *getGroupName(void) { return "GeoIndices";         }
00377     static const Char8 *getClassName(void) { return "GeoIndicesProperty"; }
00378 
00379     static InitContainerF getInitMethod(void) { return NULL; }
00380 
00382     /*---------------------------------------------------------------------*/
00386     typedef Attachment             Inherited;
00387     typedef AttachmentPtr          InheritedPtr;
00388 
00389     typedef AttachmentPropertyDesc InheritedDesc;
00390 
00391     typedef UInt32                 GenericType;
00392 
00393 #ifndef OSG_SUPPORT_NO_GEO_INTERFACE
00394     typedef GeoPropertyInterface<GeoIndicesPropertyDesc> Interface;
00395 #endif
00396 
00398 };
00399 
00400 #ifndef OSG_SUPPORT_NO_GEO_INTERFACE
00401 typedef GeoIndicesPropertyDesc::Interface GeoIndicesInterface;
00402 #endif
00403 
00409 struct GeoPTypesPropertyDesc : public GeoPropertyDesc
00410 {
00411     /*---------------------------------------------------------------------*/
00415     static const Char8 *getTypeName (void) { return "GeoPTypes"; }
00416     static const Char8 *getGroupName(void) { return "GeoPTypes"; }
00417     static const Char8 *getClassName(void) { return "GeoPTypesProperty"; }
00418 
00419     static InitContainerF getInitMethod(void) { return NULL; }
00420 
00422     /*---------------------------------------------------------------------*/
00426     typedef Attachment             Inherited;
00427     typedef AttachmentPropertyDesc InheritedDesc;
00428 
00429     typedef AttachmentPtr          InheritedPtr;
00430 
00431     typedef UInt8                  GenericType;
00432 
00433 #ifndef OSG_SUPPORT_NO_GEO_INTERFACE
00434     typedef GeoPropertyInterface<GeoPTypesPropertyDesc> Interface;
00435 #endif
00436 
00438 };
00439 
00440 
00441 #ifndef OSG_SUPPORT_NO_GEO_INTERFACE
00442 typedef GeoPTypesPropertyDesc::Interface GeoPTypesInterface;
00443 #endif
00444 
00450 struct GeoPLengthsPropertyDesc : public GeoPropertyDesc
00451 {
00452     /*---------------------------------------------------------------------*/
00456     static const Char8 *getTypeName (void) { return "GeoPLengths";         }
00457     static const Char8 *getClassName(void) { return "GeoPLengthsProperty"; }
00458     static const Char8 *getGroupName(void) { return "GeoPLengths";         }
00459 
00460     static InitContainerF getInitMethod(void) { return NULL; }
00461 
00463     /*---------------------------------------------------------------------*/
00467     typedef Attachment             Inherited;
00468     typedef AttachmentPtr          InheritedPtr;
00469 
00470     typedef AttachmentPropertyDesc InheritedDesc;
00471 
00472     typedef UInt32                 GenericType;
00473 
00474 #ifndef OSG_SUPPORT_NO_GEO_INTERFACE
00475     typedef GeoPropertyInterface<GeoPLengthsPropertyDesc> Interface;
00476 #endif
00477 
00479 };
00480 
00481 #ifndef OSG_SUPPORT_NO_GEO_INTERFACE
00482 typedef GeoPLengthsPropertyDesc::Interface GeoPLengthsInterface;
00483 #endif
00484 
00485 OSG_END_NAMESPACE
00486 
00487 #include <OSGGeoPropertyInterface.inl>
00488 
00489 #endif /* _OSGGEOPROPERTYINTERFACES_H_ */
00490 
00491 
00492 
00493 
00494 
00495 
00496 
00497 
00498 
00499 
00500 
00501 
00502 
00503 

Generated on Thu Aug 25 04:05:23 2005 for OpenSG by  doxygen 1.4.3