![]() |
http://www.sim.no/ http://www.coin3d.org/ |
00001 #ifndef COIN_SOGETPRIMITIVECOUNTACTION_H 00002 #define COIN_SOGETPRIMITIVECOUNTACTION_H 00003 00004 /**************************************************************************\ 00005 * 00006 * This file is part of the Coin 3D visualization library. 00007 * Copyright (C) by Kongsberg Oil & Gas Technologies. 00008 * 00009 * This library is free software; you can redistribute it and/or 00010 * modify it under the terms of the GNU General Public License 00011 * ("GPL") version 2 as published by the Free Software Foundation. 00012 * See the file LICENSE.GPL at the root directory of this source 00013 * distribution for additional information about the GNU GPL. 00014 * 00015 * For using Coin with software that can not be combined with the GNU 00016 * GPL, and for taking advantage of the additional benefits of our 00017 * support services, please contact Kongsberg Oil & Gas Technologies 00018 * about acquiring a Coin Professional Edition License. 00019 * 00020 * See http://www.coin3d.org/ for more information. 00021 * 00022 * Kongsberg Oil & Gas Technologies, Bygdoy Alle 5, 0257 Oslo, NORWAY. 00023 * http://www.sim.no/ sales@sim.no coin-support@coin3d.org 00024 * 00025 \**************************************************************************/ 00026 00027 #include <Inventor/actions/SoAction.h> 00028 #include <Inventor/actions/SoSubAction.h> 00029 #include <Inventor/tools/SbLazyPimplPtr.h> 00030 #include <Inventor/elements/SoDecimationTypeElement.h> 00031 00032 class SoGetPrimitiveCountActionP; 00033 00034 class COIN_DLL_API SoGetPrimitiveCountAction : public SoAction { 00035 typedef SoAction inherited; 00036 00037 SO_ACTION_HEADER(SoGetPrimitiveCountAction); 00038 00039 public: 00040 static void initClass(void); 00041 00042 SoGetPrimitiveCountAction(void); 00043 virtual ~SoGetPrimitiveCountAction(void); 00044 00045 int getTriangleCount(void) const; 00046 int getLineCount(void) const; 00047 int getPointCount(void) const; 00048 int getTextCount(void) const; 00049 int getImageCount(void) const; 00050 SbBool containsNoPrimitives(void); 00051 SbBool containsNonTriangleShapes(void); 00052 00053 SbBool is3DTextCountedAsTriangles(void); 00054 void setCount3DTextAsTriangles(const SbBool flag); 00055 00056 SbBool canApproximateCount(void); 00057 void setCanApproximate(const SbBool flag); 00058 00059 void setDecimationValue(SoDecimationTypeElement::Type type, 00060 float percentage = 1.0); 00061 SoDecimationTypeElement::Type getDecimationType(void); 00062 float getDecimationPercentage(void); 00063 00064 void addNumTriangles(const int num); 00065 void addNumLines(const int num); 00066 void addNumPoints(const int num); 00067 void addNumText(const int num); 00068 void addNumImage(const int num); 00069 void incNumTriangles(void); 00070 void incNumLines(void); 00071 void incNumPoints(void); 00072 void incNumText(void); 00073 void incNumImage(void); 00074 00075 protected: 00076 virtual void beginTraversal(SoNode * node); 00077 00078 private: 00079 int numtris; 00080 int numlines; 00081 int numpoints; 00082 int numtexts; 00083 int numimages; 00084 00085 SbBool textastris; 00086 SbBool approx; 00087 SbBool nonvertexastris; 00088 SoDecimationTypeElement::Type decimationtype; 00089 float decimationpercentage; 00090 00091 private: 00092 SbLazyPimplPtr<SoGetPrimitiveCountActionP> pimpl; 00093 00094 // NOT IMPLEMENTED: 00095 SoGetPrimitiveCountAction(const SoGetPrimitiveCountAction & rhs); 00096 SoGetPrimitiveCountAction & operator = (const SoGetPrimitiveCountAction & rhs); 00097 }; // SoGetPrimitiveCountAction 00098 00099 #endif // !COIN_SOGETPRIMITIVECOUNTACTION_H
Copyright © 1998-2010 by Kongsberg Oil & Gas Technologies. All rights reserved.
Generated on Thu Apr 28 2011 03:43:04 for Coin by Doxygen 1.7.4.