00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #ifndef __OP3D_GenericSelector_h__
00023 #define __OP3D_GenericSelector_h__
00024
00025 #include "OP3D_API.h"
00026 #include <GU/GU_SelectType.h>
00027 #include <PI/PI_ClassManager.h>
00028 #include "OP3D_InputSelector.h"
00029
00030
00031
00032
00033 class OP3D_API OP3D_SelectionEntry
00034 {
00035 public:
00036 OP3D_SelectionEntry()
00037 : myGeometryType(DM_GEOTYPE_INVALID),
00038 myMenuEntryIndex(0),
00039 myListTerminatorFlag(1) {}
00040 OP3D_SelectionEntry(DM_GeometryType geo_type,
00041 int menu_entry_index = -1)
00042 : myGeometryType(geo_type),
00043 myMenuEntryIndex(menu_entry_index),
00044 myListTerminatorFlag(0) {}
00045
00046 DM_GeometryType myGeometryType;
00047 int myMenuEntryIndex;
00048 int myListTerminatorFlag;
00049 };
00050
00051 OP3D_API extern OP3D_SelectionEntry OP3DthePrimSelOnly[];
00052 OP3D_API extern OP3D_SelectionEntry OP3DthePrimSelTypes[];
00053 OP3D_API extern OP3D_SelectionEntry OP3DthePointSelTypes[];
00054 OP3D_API extern OP3D_SelectionEntry OP3DtheEdgeSelTypes[];
00055 OP3D_API extern OP3D_SelectionEntry OP3DtheBreakpointSelTypes[];
00056 OP3D_API extern OP3D_SelectionEntry OP3DthePrimEdgeSelTypes[];
00057 OP3D_API extern OP3D_SelectionEntry OP3DthePrimPointSelTypes[];
00058 OP3D_API extern OP3D_SelectionEntry OP3DtheUVSelTypes[];
00059 OP3D_API extern OP3D_SelectionEntry OP3DtheAllSelTypes[];
00060
00061 class OP3D_API OP3D_GenericSelector : public OP3D_InputSelector
00062 {
00063 public:
00064 OP3D_GenericSelector(OP3D_View &view,
00065 PI_SelectorTemplate &templ,
00066 bool ordered = false);
00067 virtual ~OP3D_GenericSelector();
00068
00069 static BM_InputSelector *ourConstructor(BM_View &viewer,
00070 PI_SelectorTemplate &templ);
00071 static BM_InputSelector *ourOrderedConstructor(BM_View &viewer,
00072 PI_SelectorTemplate &templ);
00073
00074 virtual const char *className() const;
00075
00076 virtual void makeValidSelections(
00077 DM_GeometryType &geo_type,
00078 bool &connected,
00079 int &group_type_menu_val);
00080
00081 private:
00082 SELECTOR_SETUP_TABLE()
00083
00084
00085 const OP3D_SelectionEntry *selectionTypes()
00086 { return (OP3D_SelectionEntry *)getTemplate().data(); }
00087 };
00088
00089 #endif