14 #ifndef __OP3D_InputSelector_h__
15 #define __OP3D_InputSelector_h__
33 class OP3D_InputSelectorUndoWorker;
34 class OP3D_EdgeLoopHelper;
35 class OP3D_PatternSelectHelper;
117 DM_Viewport &viewport)
override;
119 int hotkey_id)
override;
127 { myInputRequiredFlag = onoff; }
133 {
return myUseAsteriskToSelectAll; }
135 { myUseAsteriskToSelectAll = onoff;}
141 { myUsePrimsInEdgeSelectionFlag = use_prims; }
146 { myAllowEdgeRingSelection = allow; }
151 { myOffsetVertexMarkersOverride =
offset; }
158 {
return myPrimMask; }
160 { myPrimMask = primmask; }
176 void setSloppyPick(
bool on);
178 {
return mySloppyPick; }
186 bool restrictSloppyAllowedTypesToSubset(
191 { myPickAtObjLevelFlag = flag; }
193 {
return myPickAtObjLevelFlag; }
199 void restartWithStashedSelection();
210 bool addCookedSelection(
SOP_Node *sop);
215 { myNodeIdForReselecting = node_id; }
219 virtual void clearSelections();
224 virtual void consumeSelections();
227 void removeSelectionsFromDetailLooks();
235 void setViewer(BM_View *viewer)
override;
239 void setSelectionUIValues(
UI_Value *sel_type,
251 { myCreatorStateName.harden(state_name); }
253 {
return myCreatorStateName; }
257 { myAllowDragSelFlag = allow_drag; }
261 { myFullSelFlag = select_full; }
269 setUseExistingTempSelection(use_existing);
270 setUseExistingCookSelection(use_existing);
274 return useExistingTempSelection() ||
275 useExistingCookSelection();
281 { myUseExistingTempSelection = use_existing; }
283 {
return myUseExistingTempSelection; }
289 { myUseExistingCookSelection = use_existing; }
291 {
return myUseExistingCookSelection; }
295 { myStashSelectionOnFinish = stash; }
297 {
return myStashSelectionOnFinish; }
300 { myAllowMultiPickLoopStart = allow; }
309 void setInitialSelection(
const char *op_path,
311 const char *selection_string);
328 bool connectOps(
OP_Node &new_node,
int op_input_index,
331 bool branch_off =
false,
332 bool multi_input =
false,
333 bool force_selection_string =
false,
334 bool force_numeric =
false,
338 void addSelectedInfo(
int info_i,
bool set_pick_order=
true);
339 void removeSelectedInfo(
int info_i);
343 int updateSelection(
const char *
path,
OP_Node *node,
376 bool only_selected=
true)
const;
382 bool only_selected=
true)
const;
385 bool hasNonEmptySelection()
const;
412 void selectorFinished(
bool drag =
false);
422 bool keep_original_objects,
423 bool display_origina_objects);
427 void setUndoWorker(OP3D_InputSelectorUndoWorker *worker=0);
429 OP3D_InputSelectorUndoWorker *getDefaultUndoWorker();
435 void setValidForPickFilter(
void *
data,
442 bool update_buttons);
447 int getGroupTypeMenuValAtFinish()
const;
448 bool getKeepOriginalObjects()
const;
454 bool currentlyUpdatingGeometryTypeButtons()
const;
457 void setSelectionAllowedTypes(
482 bool consume_selections)
override;
483 static void generateMergedSelectionString(
UT_String &sel_string,
488 bool use_ast_to_select_all,
503 void bootstrapLoopStart(
const char *
path,
505 bool only_selected_path);
509 void scriptReplaceSelection(
516 static bool createSelectionFromObjects(
518 DM_Viewport &viewport,
525 const char* prefix =
nullptr)
override;
538 : myNodeId(node_id), myDetailIndex(detail_index)
543 return myNodeId == key.myNodeId &&
544 myDetailIndex == key.myDetailIndex;
556 { myLocateFilter =
filter; }
565 int &group_menu_type) = 0;
605 int displayPickMask()
const;
615 void overrideSelectionValues(
int sel_type,
int sel_rule,
616 int sel_style,
int sel_full,
619 void restoreSelectionValues();
622 void saveForUndo()
override;
628 bool descriptivename)
const override;
632 bool needObjectPick()
const override;
636 bool emptySelections(
const char *path_to_skip = 0,
637 bool refresh =
true);
658 void clearSelectionInfos();
661 void clearSelectedInfoIndices();
667 int findInfo(
int node_id,
int detail_index)
const;
668 int findInfo(
const char *
path)
const;
675 friend class OP3D_InputSelectorUndo;
678 bool objects_only)
const;
686 int xcenter,
int ycenter,
687 int xsize,
int ysize);
695 bool contained_only);
706 void fullSelectionChanged(
UI_Event *);
711 DM_Viewport &viewport);
715 void revertToCookSelection(DM_Viewport &viewport);
720 void selectBoundary(DM_Viewport &viewport);
721 void selectEdgeBoundary(DM_Viewport &viewport);
722 void shrinkSelection(DM_Viewport &viewport);
723 void growSelection(DM_Viewport &viewport);
724 void selectPrimitivesWithVertexCount(
725 DM_Viewport &viewport,
726 const char *command_name,
729 using PatternExpandFunc = bool (OP3D_PatternSelectHelper::*)
733 void patternSet(DM_Viewport &viewport);
734 void patternExpand(DM_Viewport &viewport,
735 PatternExpandFunc
func,
740 void uvSelectAllByWinding(DM_Viewport &viewport,
744 void convertSelection(DM_Viewport &viewport,
750 bool &added_something);
780 bool isAnythingSelected();
787 bool *inserted_above);
791 void setVisibilitySopParameters(
SOP_Node &visibility_sop,
793 bool applying_to_selection,
797 OP3D_EdgeLoopHelper &getEdgeLoopHelper();
799 OP3D_PatternSelectHelper &getPatternSelectHelper(
int sop_node_id,
804 SOP_Node * findChosenSop(
bool &need_object_pick);
807 void doneNormalSelection();
809 bool areaSelectGeometry(
UI_Event *e,
816 bool add_to_existing_picks);
822 bool adoptLocatedItems(DM_Viewport *viewport,
825 bool force_locate =
false);
832 bool initWithPendingSelectionForVisibleOps(
834 bool &have_chosen_sop_temp_sel);
835 void stashPendingSelection();
837 void autoConvertToFinishGeometryType();
839 void addInitialSelections();
843 void updateSelectMask();
846 void resetSloppyPickMask();
849 void updateExistingSloppySelectionType(
854 void initSloppySelectionType(
860 void setSloppySelectionType(
906 bool selectionConvertBreakpointKey(
int key,
914 void handleMouseActionComplete();
919 void expandPickByNormal(
924 bool pick_all_matching_normals,
925 bool use_static_reference_normal,
931 void expandPickByFloodFill(
942 void updateLoopStartPickRecordFromPath(
943 bool record_match_state);
953 bool areVerticesOfSamePoint(
956 void extendVertexPickRecords(
964 DM_Viewport *myHotkeyViewport;
982 unsigned mySloppyPickMask;
986 bool mySloppySelectionTypeIsSet;
990 bool myCustomSelValFlag;
995 int mySavedAlwaysLocate;
1005 int myNextPickOrder;
1010 int myLastMouseDown;
1011 int myLastMouseStartX;
1012 int myLastMouseStartY;
1014 int myNodeIdForReselecting;
1016 bool myUseExistingTempSelection;
1017 bool myUseExistingCookSelection;
1018 bool myStashSelectionOnFinish;
1019 bool myInputRequiredFlag;
1020 bool myAllowDragSelFlag;
1022 bool mySaveUndosFlag;
1023 bool myUseAsteriskToSelectAll;
1024 bool myUsePrimsInEdgeSelectionFlag;
1026 bool myPickAtObjLevelFlag;
1027 bool myAllowEdgeRingSelection;
1028 int myOffsetVertexMarkersOverride;
1029 int myOffsetVertexMarkersSaved;
1033 bool myAutoConvertedSelectionsFlag;
1037 int myFinishGroupTypeMenuVal;
1044 bool myUpdatingGeometryTypeButtons;
1046 bool myHadDoubleClick;
1048 struct InitialSelection
1056 OP3D_InputSelectorUndoWorker *myUndoWorker;
1057 bool myOwnUndoWorker;
1067 OP3D_EdgeLoopHelper *myEdgeLoopHelper;
1071 bool myLoopStartPickOnlyLocated;
1072 bool myLoopStartPickRecordMatchesPath;
1074 void *myValidForPickFilterData;
1076 LocateFilter myLocateFilter =
nullptr;
1077 bool myAllowMultiPickLoopStart =
false;
GT_API const UT_StringHolder selection
Definition of a geometry attribute.
GUI_GUSelectionProxyHandle myProxy
GU_SelectionHandle selection() const
UT_SharedPtr< GUI_GUSelectionProxy > GUI_GUSelectionProxyHandle
GLsizei const GLchar *const * path
GLuint const GLchar * name
exint GA_Size
Defines the bit width for index and offset types in GA.
void updateProxy(GU_SelectionHandle sel, bool create)
GA_GroupType myActiveType
GLint GLint GLsizei GLint GLenum GLenum type
GA_API const UT_StringHolder drag
GLint GLint GLint GLint GLint GLint GLint GLbitfield GLenum filter
UT_SharedPtr< GU_Selection > GU_SelectionHandle
Contains transitional objects to provide some backward compatibility for code that references old GEO...
GUI_DetailLook * getLook() const
GA_GroupType
An ordinal enum for the different types of groups in GA.
GA_GroupType selectionType() const
OP3D_SelectionManager::ComponentScopeKey ScopeKey
UT_SharedPtr< OP3D_GUSelectionSet > OP3D_GUSelectionSetHandle
bool myIsSelectionSetOwner
GLsizei GLenum GLenum * types
GU_SelectionHandle myAutoConvertedSelection
OP3D_GUSelectionSetHandle mySelectionSet
GA_API const UT_StringHolder area
GLenum const void * paths