00001 //###################################################################### 00002 // 00003 // GraspIt! 00004 // Copyright (C) 2002-2009 Columbia University in the City of New York. 00005 // All rights reserved. 00006 // 00007 // GraspIt! is free software: you can redistribute it and/or modify 00008 // it under the terms of the GNU General Public License as published by 00009 // the Free Software Foundation, either version 3 of the License, or 00010 // (at your option) any later version. 00011 // 00012 // GraspIt! is distributed in the hope that it will be useful, 00013 // but WITHOUT ANY WARRANTY; without even the implied warranty of 00014 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00015 // GNU General Public License for more details. 00016 // 00017 // You should have received a copy of the GNU General Public License 00018 // along with GraspIt!. If not, see <http://www.gnu.org/licenses/>. 00019 // 00020 // Author(s): Andrew T. Miller 00021 // 00022 // $Id: SoArrow.h,v 1.2 2009/03/25 22:10:23 cmatei Exp $ 00023 // 00024 //###################################################################### 00025 00030 #include <Inventor/engines/SoCalculator.h> 00031 #include <Inventor/fields/SoSFFloat.h> 00032 #include <Inventor/fields/SoSFBitMask.h> 00033 #include <Inventor/nodes/SoSwitch.h> 00034 #include "SoComplexShape.h" 00035 00037 00043 class SoArrow : public SoComplexShape { 00044 00045 SO_NODE_HEADER(SoArrow); 00046 00047 public: 00048 00050 enum Part { 00051 NONE = 0x00, 00052 BEGIN = 0x01, // Arrow at the beginning of the cylinder 00053 END = 0x02, // at the end 00054 BOTH = 0x03 // at both ends 00055 }; 00056 00057 // Fields 00059 SoSFBitMask arrowHeads; 00060 00062 SoSFFloat cylRadius; 00063 00065 SoSFFloat height; 00066 00068 SoSFFloat coneHeight; 00069 00071 SoSFFloat coneRadius; 00072 00073 static void initClass(); 00074 SoArrow(); 00075 00076 void addPart(Part part); 00077 void removePart(Part part); 00078 SbBool hasPart(Part part) const; 00079 00080 private: 00081 00083 SoCalculator *calEngine; 00084 00086 SoSwitch *beginSw,*endSw; 00087 00088 virtual ~SoArrow(); 00089 00090 void generateChildren(); 00091 00092 };