00001 /* 00002 * PROPRIETARY INFORMATION. This software is proprietary to 00003 * Side Effects Software Inc., and is not to be reproduced, 00004 * transmitted, or disclosed in any way without written permission. 00005 * 00006 * Produced by: 00007 * Mark Elendt 00008 * Side Effects Software Inc. 00009 * 20 Maud St. 00010 * Toronto, Ontario, M5V 2M5 00011 * Canada 00012 * 416-366-4607 00013 * 00014 * NAME: Geometry Library (C++) 00015 * 00016 * COMMENTS: 00017 * 00018 */ 00019 00020 #ifndef __GEO_PrimMetaSQuad_H__ 00021 #define __GEO_PrimMetaSQuad_H__ 00022 00023 #include "GEO_API.h" 00024 #include <UT/UT_Vector3.h> 00025 #include "GEO_MetaPrim.h" 00026 #include "GEO_PrimSphere.h" 00027 00028 class TS_MetaSuperQuadric; 00029 00030 class GEO_API GEO_PrimMetaSQuad : public GEO_PrimSphere, public GEO_MetaPrim { 00031 public: 00032 GEO_PrimMetaSQuad(GEO_Detail *d); 00033 virtual ~GEO_PrimMetaSQuad(); 00034 00035 virtual unsigned getPrimitiveId() const; 00036 virtual void copyPrimitive(const GEO_Primitive *src, 00037 GEO_Point **ptredirect); 00038 virtual int isDegenerate() const; 00039 virtual GEO_Primitive *copy(int preserve_shared_pts = 0) const; 00040 00041 // 00042 // Methods to handle meta interface 00043 virtual void initTSdata(); 00044 virtual TS_MetaPrimitive *getMetaPrim(); 00045 virtual GEO_MetaPrim *castToMetaPrim(); 00046 virtual const GEO_MetaPrim *castToMetaPrim() const; 00047 00048 // A function that allocates a new TS_MetaSuperQuadric and returns it. 00049 // Used in the metaExpression parser to handle multiple instances 00050 // of a metaball being used in the same expression 00051 virtual TS_MetaPrimitive *getNewMetaPrim(); 00052 00053 void setXYexp(float v) { xyExp = v; } 00054 void setZexp(float v) { zExp = v; } 00055 float getXYexp(void) const { return xyExp; } 00056 float getZexp(void) const { return zExp; } 00057 00058 // Have we been deactivated and stashed? 00059 virtual void stashed(int onoff); 00060 00061 protected: 00062 virtual void copyOffsetPrimitive(const GEO_Primitive *src, 00063 int basept); 00064 virtual int savePrivate(ostream &os, int binary) const; 00065 virtual bool loadPrivate(UT_IStream &is); 00066 00067 private: 00068 00069 float xyExp, zExp; 00070 char myStashedState; 00071 00072 TS_MetaSuperQuadric *tsData; 00073 00074 }; 00075 #endif
1.5.9