00001 #ifndef COIN_SOGETPRIMITIVECOUNTACTION_H
00002 #define COIN_SOGETPRIMITIVECOUNTACTION_H
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027 #include <Inventor/actions/SoAction.h>
00028 #include <Inventor/actions/SoSubAction.h>
00029 #include <Inventor/elements/SoDecimationTypeElement.h>
00030
00031
00032 class COIN_DLL_API SoGetPrimitiveCountAction : public SoAction {
00033 typedef SoAction inherited;
00034
00035 SO_ACTION_HEADER(SoGetPrimitiveCountAction);
00036
00037 public:
00038 SoGetPrimitiveCountAction(void);
00039 virtual ~SoGetPrimitiveCountAction();
00040
00041 static void initClass(void);
00042
00043 int getTriangleCount(void) const;
00044 int getLineCount(void) const;
00045 int getPointCount(void) const;
00046 int getTextCount(void) const;
00047 int getImageCount(void) const;
00048 SbBool containsNoPrimitives(void);
00049 SbBool containsNonTriangleShapes(void);
00050
00051 SbBool is3DTextCountedAsTriangles(void);
00052 void setCount3DTextAsTriangles(const SbBool flag);
00053
00054 SbBool canApproximateCount(void);
00055 void setCanApproximate(const SbBool flag);
00056
00057 void setDecimationValue(SoDecimationTypeElement::Type type,
00058 float percentage = 1.0);
00059 SoDecimationTypeElement::Type getDecimationType(void);
00060 float getDecimationPercentage(void);
00061
00062 void addNumTriangles(const int num);
00063 void addNumLines(const int num);
00064 void addNumPoints(const int num);
00065 void addNumText(const int num);
00066 void addNumImage(const int num);
00067 void incNumTriangles(void);
00068 void incNumLines(void);
00069 void incNumPoints(void);
00070 void incNumText(void);
00071 void incNumImage(void);
00072
00073 protected:
00074 virtual void beginTraversal(SoNode * node);
00075
00076 private:
00077 int numtris;
00078 int numlines;
00079 int numpoints;
00080 int numtexts;
00081 int numimages;
00082
00083 SbBool textastris;
00084 SbBool approx;
00085 SbBool nonvertexastris;
00086 SoDecimationTypeElement::Type decimationtype;
00087 float decimationpercentage;
00088 };
00089
00090 #endif // !COIN_SOGETPRIMITIVECOUNTACTION_H