14 #ifndef __OP3D_InputSelector_h__
15 #define __OP3D_InputSelector_h__
33 class DM_HeldHotkeyCache;
34 class OP3D_InputSelectorUndoWorker;
35 class OP3D_EdgeLoopHelper;
36 class OP3D_PatternSelectHelper;
119 DM_Viewport &viewport)
override;
121 int hotkey_id)
override;
129 { myInputRequiredFlag = onoff; }
135 {
return myUseAsteriskToSelectAll; }
137 { myUseAsteriskToSelectAll = onoff;}
143 { myUsePrimsInEdgeSelectionFlag = use_prims; }
148 { myAllowEdgeRingSelection = allow; }
153 { myOffsetVertexMarkersOverride =
offset; }
160 {
return myPrimMask; }
162 { myPrimMask = primmask; }
178 void setSloppyPick(
bool on);
180 {
return mySloppyPick; }
188 bool restrictSloppyAllowedTypesToSubset(
193 { myPickAtObjLevelFlag = flag; }
195 {
return myPickAtObjLevelFlag; }
201 void restartWithStashedSelection();
212 bool addCookedSelection(
SOP_Node *sop);
217 { myNodeIdForReselecting = node_id; }
221 virtual void clearSelections();
226 virtual void consumeSelections();
229 void removeSelectionsFromDetailLooks();
237 void setViewer(BM_View *viewer)
override;
241 void setSelectionUIValues(
UI_Value *sel_type,
254 { myCreatorStateName.harden(state_name); }
256 {
return myCreatorStateName; }
260 { myAllowDragSelFlag = allow_drag; }
264 { myFullSelFlag = select_full; }
272 setUseExistingTempSelection(use_existing);
273 setUseExistingCookSelection(use_existing);
277 return useExistingTempSelection() ||
278 useExistingCookSelection();
284 { myUseExistingTempSelection = use_existing; }
286 {
return myUseExistingTempSelection; }
292 { myUseExistingCookSelection = use_existing; }
294 {
return myUseExistingCookSelection; }
298 { myStashSelectionOnFinish = stash; }
300 {
return myStashSelectionOnFinish; }
303 { myAllowMultiPickLoopStart = allow; }
312 void setInitialSelection(
const char *op_path,
314 const char *selection_string);
331 bool connectOps(
OP_Node &new_node,
int op_input_index,
334 bool branch_off =
false,
335 bool multi_input =
false,
336 bool force_selection_string =
false,
337 bool force_numeric =
false,
341 void addSelectedInfo(
int info_i,
bool set_pick_order=
true);
342 void removeSelectedInfo(
int info_i);
346 int updateSelection(
const char *
path,
OP_Node *node,
379 bool only_selected=
true)
const;
385 bool only_selected=
true)
const;
388 bool hasNonEmptySelection()
const;
415 void selectorFinished(
bool drag =
false);
425 bool keep_original_objects,
426 bool display_origina_objects);
430 void setUndoWorker(OP3D_InputSelectorUndoWorker *worker=0);
432 OP3D_InputSelectorUndoWorker *getDefaultUndoWorker();
438 void setValidForPickFilter(
void *
data,
445 bool update_buttons);
450 int getGroupTypeMenuValAtFinish()
const;
451 bool getKeepOriginalObjects()
const;
457 bool currentlyUpdatingGeometryTypeButtons()
const;
460 void setSelectionAllowedTypes(
485 bool consume_selections)
override;
486 static void generateMergedSelectionString(
UT_String &sel_string,
491 bool use_ast_to_select_all,
506 void bootstrapLoopStart(
const char *
path,
508 bool only_selected_path);
512 void scriptReplaceSelection(
519 static bool createSelectionFromObjects(
521 DM_Viewport &viewport,
528 const char* prefix =
nullptr)
override;
546 : myNodeId(node_id), myDetailIndex(detail_index)
551 return myNodeId == key.myNodeId &&
552 myDetailIndex == key.myDetailIndex;
564 { myLocateFilter =
filter; }
576 int &group_menu_type) = 0;
616 int displayPickMask()
const;
626 void overrideSelectionValues(
int sel_type,
int sel_rule,
627 int sel_style,
int sel_full,
630 void restoreSelectionValues();
633 void saveForUndo()
override;
639 bool descriptivename)
const override;
643 bool needObjectPick()
const override;
647 bool emptySelections(
const char *path_to_skip = 0,
648 bool refresh =
true);
669 void clearSelectionInfos();
672 void clearSelectedInfoIndices();
678 int findInfo(
int node_id,
int detail_index)
const;
679 int findInfo(
const char *
path)
const;
686 friend class OP3D_InputSelectorUndo;
689 bool objects_only)
const;
697 int xcenter,
int ycenter,
698 int xsize,
int ysize);
706 bool contained_only);
717 void fullSelectionChanged(
UI_Event *);
722 DM_Viewport &viewport);
726 void revertToCookSelection(DM_Viewport &viewport);
731 void selectBoundary(DM_Viewport &viewport);
732 void selectEdgeBoundary(DM_Viewport &viewport);
733 void shrinkSelection(DM_Viewport &viewport);
734 void growSelection(DM_Viewport &viewport);
735 void selectPrimitivesWithVertexCount(
736 DM_Viewport &viewport,
737 const char *command_name,
740 using PatternExpandFunc = bool (OP3D_PatternSelectHelper::*)
744 void patternSet(DM_Viewport &viewport);
745 void patternExpand(DM_Viewport &viewport,
746 PatternExpandFunc
func,
751 void uvSelectAllByWinding(DM_Viewport &viewport,
755 void convertSelection(DM_Viewport &viewport,
761 bool &added_something);
791 bool isAnythingSelected();
798 bool *inserted_above);
802 void setVisibilitySopParameters(
SOP_Node &visibility_sop,
804 bool applying_to_selection,
808 OP3D_EdgeLoopHelper &getEdgeLoopHelper();
810 OP3D_PatternSelectHelper &getPatternSelectHelper(
int sop_node_id,
815 SOP_Node * findChosenSop(
bool &need_object_pick);
818 void doneNormalSelection();
820 bool areaSelectGeometry(
UI_Event *e,
827 bool add_to_existing_picks);
833 bool adoptLocatedItems(DM_Viewport *viewport,
836 bool force_locate =
false);
843 bool initWithPendingSelectionForVisibleOps(
845 bool &have_chosen_sop_temp_sel);
846 void stashPendingSelection();
848 void autoConvertToFinishGeometryType();
850 void addInitialSelections();
854 void updateSelectMask();
857 void resetSloppyPickMask();
860 void updateExistingSloppySelectionType(
865 void initSloppySelectionType(
871 void setSloppySelectionType(
917 bool selectionConvertBreakpointKey(
int key,
925 void handleMouseActionComplete();
930 void expandPickByNormal(
935 bool pick_all_matching_normals,
936 bool use_static_reference_normal,
942 void expandPickByFloodFill(
953 void updateLoopStartPickRecordFromPath(
954 bool record_match_state);
964 bool areVerticesOfSamePoint(
967 void extendVertexPickRecords(
984 DM_Viewport *myHotkeyViewport;
1002 unsigned mySloppyPickMask;
1006 bool mySloppySelectionTypeIsSet;
1010 bool myCustomSelValFlag;
1013 int mySavedSelStyle;
1015 int mySavedAlwaysLocate;
1025 int myNextPickOrder;
1030 int myLastMouseDown;
1031 int myLastMouseStartX;
1032 int myLastMouseStartY;
1034 bool myResizingCursor;
1036 int myNodeIdForReselecting;
1038 bool myUseExistingTempSelection;
1039 bool myUseExistingCookSelection;
1040 bool myStashSelectionOnFinish;
1041 bool myInputRequiredFlag;
1042 bool myAllowDragSelFlag;
1044 bool mySaveUndosFlag;
1045 bool myUseAsteriskToSelectAll;
1046 bool myUsePrimsInEdgeSelectionFlag;
1048 bool myPickAtObjLevelFlag;
1049 bool myAllowEdgeRingSelection;
1050 int myOffsetVertexMarkersOverride;
1051 int myOffsetVertexMarkersSaved;
1055 bool myAutoConvertedSelectionsFlag;
1059 int myFinishGroupTypeMenuVal;
1066 bool myUpdatingGeometryTypeButtons;
1068 bool myHadDoubleClick;
1070 struct InitialSelection
1078 OP3D_InputSelectorUndoWorker *myUndoWorker;
1079 bool myOwnUndoWorker;
1082 HeldHotkeyCacheUPtr myHeldHotkeyCache;
1091 OP3D_EdgeLoopHelper *myEdgeLoopHelper;
1095 bool myLoopStartPickOnlyLocated;
1096 bool myLoopStartPickRecordMatchesPath;
1098 void *myValidForPickFilterData;
1100 LocateFilter myLocateFilter =
nullptr;
1101 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
exint GA_Size
Defines the bit width for index and offset types in GA.
void updateProxy(GU_SelectionHandle sel, bool create)
GA_GroupType myActiveType
std::unique_ptr< T, Deleter > UT_UniquePtr
A smart pointer for unique ownership of dynamically allocated objects.
GA_API const UT_StringHolder drag
GLuint const GLchar * name
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
GLint GLint GLint GLint GLint GLint GLint GLbitfield GLenum filter