14 #ifndef __OP3D_InputSelector_h__
15 #define __OP3D_InputSelector_h__
34 class DM_HeldHotkeyCache;
35 class OP3D_InputSelectorUndoWorker;
36 class OP3D_EdgeLoopHelper;
37 class OP3D_PatternSelectHelper;
125 DM_Viewport &viewport)
override;
127 int hotkey_id)
override;
135 { myInputRequiredFlag = onoff; }
141 {
return myUseAsteriskToSelectAll; }
143 { myUseAsteriskToSelectAll = onoff;}
149 { myUsePrimsInEdgeSelectionFlag = use_prims; }
154 { myAllowEdgeRingSelection = allow; }
159 { myOffsetVertexMarkersOverride =
offset; }
166 {
return myPrimMask; }
168 { myPrimMask = primmask; }
184 void setSloppyPick(
bool on);
186 {
return mySloppyPick; }
194 bool restrictSloppyAllowedTypesToSubset(
199 { myPickAtObjLevelFlag = flag; }
201 {
return myPickAtObjLevelFlag; }
207 void restartWithStashedSelection();
218 bool addCookedSelection(
SOP_Node *sop);
223 { myNodeIdForReselecting = node_id; }
227 virtual void clearSelections();
232 virtual void consumeSelections();
235 void removeSelectionsFromDetailLooks();
242 void stashPendingSelection();
250 void setViewer(BM_View *viewer)
override;
254 void setSelectionUIValues(
UI_Value *sel_type,
267 { myCreatorStateName.harden(state_name); }
269 {
return myCreatorStateName; }
273 { myAllowDragSelFlag = allow_drag; }
277 { myFullSelFlag = select_full; }
285 setUseExistingTempSelection(use_existing);
286 setUseExistingCookSelection(use_existing);
290 return useExistingTempSelection() ||
291 useExistingCookSelection();
297 { myUseExistingTempSelection = use_existing; }
299 {
return myUseExistingTempSelection; }
305 { myUseExistingCookSelection = use_existing; }
307 {
return myUseExistingCookSelection; }
311 { myStashSelectionOnFinish = stash; }
313 {
return myStashSelectionOnFinish; }
316 { myAllowMultiPickLoopStart = allow; }
325 void setInitialSelection(
const char *op_path,
327 const char *selection_string);
344 bool connectOps(
OP_Node &new_node,
int op_input_index,
347 bool branch_off =
false,
348 bool multi_input =
false,
349 bool force_selection_string =
false,
350 bool force_numeric =
false,
354 void addSelectedInfo(
int info_i,
bool set_pick_order=
true);
355 void removeSelectedInfo(
int info_i);
359 int updateSelection(
const char *
path,
OP_Node *node,
392 bool only_selected=
true)
const;
398 bool only_selected=
true)
const;
401 bool hasNonEmptySelection()
const;
428 void selectorFinished(
bool drag =
false);
438 bool keep_original_objects,
439 bool display_origina_objects);
443 void setUndoWorker(OP3D_InputSelectorUndoWorker *worker=0);
445 OP3D_InputSelectorUndoWorker *getDefaultUndoWorker();
451 void setValidForPickFilter(
void *
data,
458 bool update_buttons);
463 int getGroupTypeMenuValAtFinish()
const;
464 bool getKeepOriginalObjects()
const;
470 bool currentlyUpdatingGeometryTypeButtons()
const;
473 void setSelectionAllowedTypes(
498 bool consume_selections)
override;
499 static void generateMergedSelectionString(
UT_String &sel_string,
504 bool use_ast_to_select_all,
519 void bootstrapLoopStart(
const char *
path,
521 bool only_selected_path);
525 void scriptReplaceSelection(
532 static bool createSelectionFromObjects(
534 DM_Viewport &viewport,
541 const char* prefix =
nullptr)
override;
559 : myNodeId(node_id), myDetailIndex(detail_index)
564 return myNodeId == key.myNodeId &&
565 myDetailIndex == key.myDetailIndex;
577 { myLocateFilter =
filter; }
589 int &group_menu_type) = 0;
629 int displayPickMask()
const;
639 void overrideSelectionValues(
int sel_type,
int sel_rule,
640 int sel_style,
int sel_full,
643 void restoreSelectionValues();
646 void saveForUndo()
override;
652 bool descriptivename)
const override;
656 bool needObjectPick()
const override;
660 bool emptySelections(
const char *path_to_skip = 0,
661 bool refresh =
true);
682 void clearSelectionInfos();
685 void clearSelectedInfoIndices();
691 int findInfo(
int node_id,
int detail_index)
const;
692 int findInfo(
const char *
path)
const;
699 friend class OP3D_InputSelectorUndo;
702 bool objects_only)
const;
710 int xcenter,
int ycenter,
711 int xsize,
int ysize);
719 bool contained_only);
730 void fullSelectionChanged(
UI_Event *);
735 DM_Viewport &viewport);
739 void revertToCookSelection(DM_Viewport &viewport);
744 void selectBoundary(DM_Viewport &viewport);
745 void selectEdgeBoundary(DM_Viewport &viewport);
746 void shrinkSelection(DM_Viewport &viewport);
747 void growSelection(DM_Viewport &viewport);
748 void selectPrimitivesWithVertexCount(
749 DM_Viewport &viewport,
750 const char *command_name,
753 using PatternExpandFunc =
bool (OP3D_PatternSelectHelper::*)
757 void patternSet(DM_Viewport &viewport);
758 void patternExpand(DM_Viewport &viewport,
759 PatternExpandFunc
func,
764 void uvSelectAllByWinding(DM_Viewport &viewport,
768 void convertSelection(DM_Viewport &viewport,
774 bool &added_something);
804 bool isAnythingSelected();
811 bool *inserted_above);
815 void setVisibilitySopParameters(
SOP_Node &visibility_sop,
817 bool applying_to_selection,
821 OP3D_EdgeLoopHelper &getEdgeLoopHelper();
823 OP3D_PatternSelectHelper &getPatternSelectHelper(
int sop_node_id,
828 SOP_Node * findChosenSop(
bool &need_object_pick);
831 void doneNormalSelection();
833 bool areaSelectGeometry(
UI_Event *e,
840 bool add_to_existing_picks);
846 bool adoptLocatedItems(DM_Viewport *viewport,
849 bool force_locate =
false);
856 bool initWithPendingSelectionForVisibleOps(
858 bool &have_chosen_sop_temp_sel);
860 void autoConvertToFinishGeometryType();
862 void addInitialSelections();
866 void updateSelectMask();
869 void resetSloppyPickMask();
872 void updateExistingSloppySelectionType(
877 void initSloppySelectionType(
883 void setSloppySelectionType(
929 bool selectionConvertBreakpointKey(
int key,
937 void handleMouseActionComplete();
942 void expandPickByNormal(
947 bool pick_all_matching_normals,
948 bool use_static_reference_normal,
954 void expandPickByFloodFill(
965 void updateLoopStartPickRecordFromPath(
966 bool record_match_state);
976 bool areVerticesOfSamePoint(
979 void extendVertexPickRecords(
996 DM_Viewport *myHotkeyViewport;
1014 unsigned mySloppyPickMask;
1018 bool mySloppySelectionTypeIsSet;
1022 bool myCustomSelValFlag;
1025 int mySavedSelStyle;
1027 int mySavedAlwaysLocate;
1037 int myNextPickOrder;
1042 int myLastMouseDown;
1043 int myLastMouseStartX;
1044 int myLastMouseStartY;
1046 bool myResizingCursor;
1048 int myNodeIdForReselecting;
1050 bool myUseExistingTempSelection;
1051 bool myUseExistingCookSelection;
1052 bool myStashSelectionOnFinish;
1053 bool myInputRequiredFlag;
1054 bool myAllowDragSelFlag;
1056 bool mySaveUndosFlag;
1057 bool myUseAsteriskToSelectAll;
1058 bool myUsePrimsInEdgeSelectionFlag;
1060 bool myPickAtObjLevelFlag;
1061 bool myAllowEdgeRingSelection;
1062 int myOffsetVertexMarkersOverride;
1063 int myOffsetVertexMarkersSaved;
1067 bool myAutoConvertedSelectionsFlag;
1071 int myFinishGroupTypeMenuVal;
1078 bool myUpdatingGeometryTypeButtons;
1080 bool myHadDoubleClick;
1082 struct InitialSelection
1090 OP3D_InputSelectorUndoWorker *myUndoWorker;
1091 bool myOwnUndoWorker;
1094 HeldHotkeyCacheUPtr myHeldHotkeyCache;
1103 OP3D_EdgeLoopHelper *myEdgeLoopHelper;
1107 bool myLoopStartPickOnlyLocated;
1108 bool myLoopStartPickRecordMatchesPath;
1110 void *myValidForPickFilterData;
1112 LocateFilter myLocateFilter =
nullptr;
1113 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
Temporary container for either a RV_Render and an RE_Render.
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.
GLint GLint GLsizei GLint GLenum GLenum type
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