Rhino C++ API
8.14
|
#include <rhinoSdkGetRectangle.h>
Public Member Functions | |
CRhinoGetRectangle (CArgsRhinoGetPlane &) | |
~CRhinoGetRectangle () | |
BOOL32 | Corners (ON_3dPoint rect[4]) const |
std::function< void(const ON_3dPoint[4])> | DynamicRectangleCallback () const |
CRhinoGet::result | GetRectangle (CRhinoHistory *history) |
void | SetDynamicRectangleCallback (std::function< void(const ON_3dPoint[4])> callback) |
Public Member Functions inherited from CRhinoGetPoint | |
CRhinoGetPoint () | |
CRhinoGetPoint (const CRhinoGet &src) | |
prompt and options copied More... | |
CRhinoGetPoint (const CRhinoGetPoint &)=delete | |
no implementation More... | |
virtual | ~CRhinoGetPoint () |
int | AddConstructionPoint (const ON_3dPoint &construction_point) |
int | AddSnapPoint (const ON_3dPoint &snap_point) |
int | AddSnapPoints (BOOL32 bRationalPoints, int point_count, int point_stride, const double *points) |
int | AddSnapPoints (int point_count, const ON_3dPoint *snap_points) |
const CRhinoObjRef & | BaseObjRef () const |
ON_3dPoint | BasePoint () const |
void | ClearConstraints () |
void | ClearConstructionPoints () |
void | ClearLineConstraint () |
void | ClearSnapPoints () |
bool | ComplexPointInput () const |
BOOL32 | Constrain (const ON_Arc &) |
constrain point to lie on an arc More... | |
BOOL32 | Constrain (const ON_Brep &, int wire_density=-1, int face_index=-1, bool bAllowPickingPointOffObject=false) |
BOOL32 | Constrain (const ON_BrepFace &, int wire_density=-1, bool bAllowPickingPointOffObject=false) |
BOOL32 | Constrain (const ON_Circle &) |
constrain point to lie on a circle More... | |
BOOL32 | Constrain (const ON_Curve &, bool bAllowPickingPointOffObject=false) |
BOOL32 | Constrain (const ON_Cylinder &) |
constrain point to lie on a cylinder More... | |
BOOL32 | Constrain (const ON_Line &, BOOL32 bTrackFromStart=true) |
constrain to a line More... | |
BOOL32 | Constrain (const ON_Mesh &, bool bAllowPickingPointOffObject=false) |
BOOL32 | Constrain (const ON_Plane &, bool bAllowElevator=false) |
constrain point to lie on a plane More... | |
BOOL32 | Constrain (const ON_Sphere &) |
constrain point to lie on a sphere More... | |
BOOL32 | Constrain (const ON_Surface &, bool bAllowPickingPointOffObject=false) |
BOOL32 | Constrain (ON_3dPoint, ON_3dPoint) |
constrain to a line More... | |
void | ConstrainDistanceFromBasePoint (double distance_from_basepoint) |
bool | Constrained () const |
BOOL32 | ConstrainEx (const ON_Mesh &, bool bAllowPickingPointOffObject=false, double dOffset=0.0) |
BOOL32 | ConstrainEx (const ON_SubD &, bool bAllowPickingPointOffObject=false, double dOffset=0.0) |
BOOL32 | ConstrainToConstructionPlane (BOOL32 bThroughBasePoint=true, BOOL32 bProjectOsnaps=false) |
BOOL32 | ConstrainToTargetPlane () |
BOOL32 | ConstrainToVirtualCPlaneIntersection (const ON_Plane &) |
HCURSOR | CurrentCursor () const |
void | DrawLineFromPoint (ON_3dPoint start_point, BOOL32 bShowDistanceInStatusBar) |
bool | DrawsShadedMeshes () const |
virtual void | DynamicDraw (HDC, CRhinoViewport &, const ON_3dPoint &) |
const ON_BoundingBox & | DynamicDrawBounds () const |
ON_Color | DynamicDrawColor () const |
void | EnableCurveSnapArrow (BOOL32 bDrawDirectionArrowAtSnapPoint=true, BOOL32 bReverseArrow=false) |
void | EnableCurveSnapPerpBar (BOOL32 bDrawPerpBarAtSnapPoint=true, BOOL32 bDrawEndPoints=false) |
void | EnableCurveSnapTangentBar (BOOL32 bDrawTangentBarAtSnapPoint=true, BOOL32 bDrawEndPoints=false) |
void | EnableDrawLineFromPoint (BOOL32 bDrawLineFromPoint=true) |
void | EnableNoRedrawOnExit (bool bNoRedrawOnExit=true) |
void | EnableObjectSnapCursors (bool bEnableObjectSnapCursors=true) |
void | EnableOneShotOsnapHiddenOptions (bool bEnable) |
void | EnableOnObjectCursors (bool bEnableOnObjectCursors=true) |
void | EnableSnapToCurves (BOOL32=true) |
CRhinoGet::result | Get2dLine (CRhinoView *pView=NULL, const POINT *corner=NULL, BOOL32 bCentered=false, int pen_style=PS_SOLID, bool bClampToView=true) |
CRhinoGet::result | Get2dPoint (CRhinoView *pView=NULL, bool bOnMouseUp=false) |
CRhinoGet::result | Get2dRectangle (CRhinoView *pView=NULL, const POINT *corner=NULL, BOOL32 bCentered=false, int pen_style=PS_SOLID, bool bClampToView=true, const wchar_t *second_prompt=NULL) |
int | GetConstructionPoints (ON_SimpleArray< ON_3dPoint > &construction_points) const |
BOOL32 | GetPlanarConstraint (const CRhinoViewport *vp, ON_Plane &plane) const |
CRhinoGet::result | GetPoint (CRhinoHistory *history=nullptr, bool bOnMouseUp=false) |
HCURSOR | GetPointCursor () const |
bool | GetPointOnMouseUp () const |
true if getting point on mouse up event More... | |
int | GetSnapPoints (ON_SimpleArray< ON_3dPoint > &snap_points) const |
bool | GetTabModeSettings (int *tab_mode=0, ON_Line *tab_mode_line=0) |
bool | GetView3dPoint (UINT nPointingDevice, CRhinoView &view, UINT_PTR nFlags, ON_3dPoint device_point, const ON_Line &world_line, ON_3dPoint &world_point) |
BOOL32 | HasBasePoint () const |
BOOL32 | InterruptMouseMove () const |
tool for use in More... | |
bool | MouseMoved () const |
bool | NumberPreview (double *number=nullptr) const |
virtual void | OnMouseDown (CRhinoViewport &vp, UINT nFlags, const ON_3dPoint &point, const ON_2iPoint *view_wnd_point) |
int | OnViewMouseDown (CRhinoView &, int button, UINT nFlags, const ON_2iPoint &point, CRhinoViewport &vp) |
these functions are used by CRhinoView::OnMouseDown/Move/Up - pretend they don't exist More... | |
int | OnViewMouseMove (CRhinoView &, int button, UINT nFlags, const ON_2iPoint &point, CRhinoViewport &vp) |
int | OnViewMouseUp (CRhinoView &, int button, UINT nFlags, const ON_2iPoint &point, CRhinoViewport &vp) |
CRhinoGetPoint & | operator= (const CRhinoGetPoint &)=delete |
bool | OrthoSnap () const |
bool | OsnapOverideEnabled (CRhinoAppSettings::osnap_mode &mode) const |
void | PermitConstraintOptions (BOOL32 bPermitConstraintOptions=true) |
void | PermitElevatorMode (int permit_elevator_mode=1) |
void | PermitFromOption (BOOL32 bPermitFromOption=true) |
void | PermitObjectSnap (BOOL32 bPermitObjectSnap=true) |
void | PermitOrthoSnap (BOOL32 bPermitOrthoSnap=true) |
void | PermitTabMode (bool bPermitTabMode=true) |
ON_3dPoint | Point () const |
returns 3d point in world coordinates More... | |
const ON_BrepFace * | PointOnBrep (double *u, double *v) const |
const ON_Curve * | PointOnCurve (double *t) const |
const ON_BrepEdge * | PointOnEdge (double *edge_parameter, const ON_BrepTrim *&pTrim) const |
BOOL32 | PointOnObject (CRhinoObjRef &) const |
const ON_Surface * | PointOnSurface (double *u, double *v) const |
void | ProhibitObjectSnap (const CRhinoObject *object) |
void | SetBaseObjRef (const CRhinoObjRef &ref) |
void | SetBasePoint (ON_3dPoint basePoint, bool showDistanceInStatusBar=false) |
void | SetComplexPointInput (bool b) |
void | SetDrawsShadedMeshes (bool on) |
void | SetDynamicDrawBounds (const ON_BoundingBox &bbox) |
void | SetDynamicDrawColor (COLORREF color) |
HCURSOR | SetGetPointCursor (HCURSOR getpoint_cursor) |
void | SetNumberPreview (double number) |
const CRhinoSnapEvent & | SnapEvent () const |
Public Member Functions inherited from CRhinoGet | |
CRhinoGet (TYPE) | |
CRhinoGet (TYPE, const CRhinoGet &) | |
virtual | ~CRhinoGet () |
void | AcceptColor (BOOL32 b=true) |
bool | AcceptCustomWindowsMessage (UINT winmsg_id) |
void | AcceptNothing (BOOL32 b=true) |
void | AcceptNumber (bool b=true, bool bAcceptZero=true) |
void | AcceptPoint (BOOL32 b=true) |
void | AcceptString (BOOL32 b=true) |
void | AcceptUndo (BOOL32 b=true) |
call to allow user undo previous selection. More... | |
int | AddCommandOption (CRhinoCommandOptionName option_name, CRhinoCommandOptionValue option_value=CRhinoCommandOptionValue(nullptr, nullptr), BOOL32 bHiddenOption=false) |
int | AddCommandOption (CRhinoCommandOptionName option_name, double number_value) |
int | AddCommandOption (CRhinoCommandOptionName option_name, int number_value) |
int | AddCommandOptionColor (CRhinoCommandOptionName option_name, ON_Color *color_value, const wchar_t *option_prompt=nullptr) |
int | AddCommandOptionInteger (CRhinoCommandOptionName option_name, int *integer_value, const wchar_t *option_prompt=nullptr, double lower_limit=ON_UNSET_VALUE, double upper_limit=ON_UNSET_VALUE) |
int | AddCommandOptionList (CRhinoCommandOptionName option_name, const ON_SimpleArray< CRhinoCommandOptionValue > &list_values, int list_current_index) |
int | AddCommandOptionList (CRhinoCommandOptionName option_name, int list_current_index, CRhinoCommandOptionValue list0_value=CRhinoCommandOptionValue(nullptr, nullptr), CRhinoCommandOptionValue list1_value=CRhinoCommandOptionValue(nullptr, nullptr), CRhinoCommandOptionValue list2_value=CRhinoCommandOptionValue(nullptr, nullptr), CRhinoCommandOptionValue list3_value=CRhinoCommandOptionValue(nullptr, nullptr), CRhinoCommandOptionValue list4_value=CRhinoCommandOptionValue(nullptr, nullptr), CRhinoCommandOptionValue list5_value=CRhinoCommandOptionValue(nullptr, nullptr), CRhinoCommandOptionValue list6_value=CRhinoCommandOptionValue(nullptr, nullptr), CRhinoCommandOptionValue list7_value=CRhinoCommandOptionValue(nullptr, nullptr), CRhinoCommandOptionValue list8_value=CRhinoCommandOptionValue(nullptr, nullptr), CRhinoCommandOptionValue list9_value=CRhinoCommandOptionValue(nullptr, nullptr)) |
int | AddCommandOptionList (CRhinoCommandOptionName option_name, int list_values_count, const CRhinoCommandOptionValue *list_values, int list_current_index) |
int | AddCommandOptionNumber (CRhinoCommandOptionName option_name, double *number_value, const wchar_t *option_prompt=nullptr, BOOL32 bIntegerValue=false, double lower_limit=ON_UNSET_VALUE, double upper_limit=ON_UNSET_VALUE, int number_format=0) |
int | AddCommandOptionToggle (CRhinoCommandOptionName option_name, CRhinoCommandOptionValue option_off_value, CRhinoCommandOptionValue option_on_value, bool bToggleState, bool *bCurrentToggleState=nullptr) |
int | AddCommandOptionToggle (CRhinoCommandOptionName option_name, CRhinoCommandOptionValue option_off_value, CRhinoCommandOptionValue option_on_value, BOOL32 bToggleState, BOOL32 *bCurrentToggleState=nullptr) |
void | AddHiddenCommandOptionAlias (int option_index, const wchar_t *alias1, const wchar_t *alias2=nullptr, const wchar_t *alias3=nullptr, const wchar_t *alias4=nullptr) |
low level tool More... | |
void | ClearCommandOptions () |
Clear all command line options. More... | |
void | ClearDefault () |
ON_Color | Color () const |
Used to get color if Get*() returns CRhinoGet::color. More... | |
CRhinoCommand::result | CommandResult () const |
const ON_Color & | DefaultColor () const |
double | DefaultNumber () const |
unsigned int | DocumentRuntimeSerialNumber () const |
void | EnableTransparentCommands (BOOL32 bEnableTransparentCommands) |
BOOL32 | GotDefault () const |
bool | In2dGet () const |
these functions are used by CRhinoView::OnMouseDown/Move/Up - pretend they don't exist More... | |
bool | IsGetColor () const |
bool | IsGetMeshes () const |
bool | IsGetNumber () const |
bool | IsGetObject () const |
bool | IsGetOption () const |
bool | IsGetPoint () const |
bool | IsGetString () const |
RH_LINE | Line2d () const |
double | Number () const |
const CRhinoCommandOption * | Option () const |
int | OptionCount () const |
Get the number of available command line options. This information is useful when command flow depends on the existence of command line options. More... | |
int | OptionCurrentListOptionIndex () const |
int | OptionIndex () const |
CRhinoCommandOption::COMMAND_OPTION_TYPE | OptionType () const |
ON_4iRect | PickRect () const |
ON_3dPoint | Point () const |
Used to get point if Get*() returns CRhinoGet::point. More... | |
ON_2iPoint | Point2d () const |
ON_4iRect | Rectangle2d () const |
CRhinoGet::result | Result () const |
returns result of the Get*() call More... | |
unsigned int | SerialNumber () const |
low level tool used to identify the get More... | |
void | SetCommandPrompt (const wchar_t *prompt) |
void | SetCommandPromptDefault (const wchar_t *default_value) |
void | SetDefaultColor (ON_Color default_color) |
void | SetDefaultColor (ON_Color default_color, bool bUseAlpha) |
void | SetDefaultInteger (int default_integer) |
void | SetDefaultNumber (double default_number, const wchar_t *format=nullptr) |
void | SetDefaultPoint (ON_3dPoint default_point) |
void | SetDefaultString (const wchar_t *default_string) |
void | SetDocument (unsigned int rhino_doc_sn) |
void | SetOptionVaries (int option_index, bool bVaries) |
Set option that uses "option_name=value" format to show the value as "Varies". More... | |
void | SetVector (const ON_3dVector &v) |
void | SetWaitDuration (double seconds) |
const wchar_t * | String () const |
TYPE | Type () const |
ON_3dVector | Vector () const |
CRhinoView * | View () const |
MSG | WindowsMessage () const |
ON_3dPoint | WorldPoint1 () const |
ON_3dPoint | WorldPoint2 () const |
Protected Member Functions | |
CRhinoGetRectangle (const CRhinoGetRectangle &src) | |
not implemented More... | |
BOOL32 | CalcCorners (CRhinoViewport &vp, const ON_3dPoint &point, ON_3dPoint corners[4]) const |
void | DynamicDraw (CRhinoDisplayPipeline &, const ON_3dPoint &dragpoint) override |
void | OnMouseMove (CRhinoViewport &, UINT nFlags, const ON_3dPoint &, const ON_2iPoint *) override |
CRhinoGetRectangle & | operator= (const CRhinoGetRectangle &src) |
Protected Member Functions inherited from CRhinoGetPoint | |
ON_Plane | GetCS (bool bWorldCoordinates, bool bRelativeCoordinates) override |
Helper used by IsAcceptableInput when parsing points. More... | |
bool | InElevatorMode (ON_Line &elevator) const |
Protected Member Functions inherited from CRhinoGet | |
CRhinoGet::result | AutoProcessOption () |
const CRhinoCommandOption * | CommandOptionAtIndex (int option_index) const |
int | CommandOptionCount () const |
see source for comments More... | |
CRhinoGet::result | IsAcceptableInput (const class CRhEventToken &, BOOL32 bAcceptNumber, BOOL32 *bUpdatedOptionValue, CRhinoHistory *history) |
CRhinoGet & | operator= (const CRhinoGet &) |
void | PreGet () |
void | RemoveCommandOptions (int option_index) |
see source for comments More... | |
virtual void | SetCommandWndPrompt () const |
void | SetOptionAccelerators () |
Additional Inherited Members | |
Public Types inherited from CRhinoGet | |
enum | result { no_result = 0, cancel = 1, nothing = 2, option, number, color, undo, miss, point, point2d, line2d, rect2d, object, string, winmsg, timeout, circle, plane, cylinder, sphere, angle, distance, direction, frame, number_preview, point_preview, user1 = 0xFFFFFFFF, user2 = 0xFFFFFFFE, user3 = 0xFFFFFFFD, user4 = 0xFFFFFFFC, user5 = 0xFFFFFFFB, exit_rhino = 0x0FFFFFFF } |
enum | TYPE { get_string = 1, get_point = 2, get_object = 3, get_meshes = 4, get_option = 5, get_number = 6, get_color = 7, force_32bit_enum = 0xFFFFFFFF } |
Static Public Member Functions inherited from CRhinoGet | |
static BOOL32 | IsValidOptionName (const wchar_t *option_name) |
static BOOL32 | IsValidOptionValueName (const wchar_t *option_value) |
static void | PostCustomWindowsMessage (UINT Msg, WPARAM wParam, LPARAM lParam) |
Public Attributes inherited from CRhinoGet | |
class CRhGetSdkExtension * | m__rhino_get_sdk_extension |
Copyright (c) 1993-2017 Robert McNeel & Associates. All rights reserved. Rhinoceros is a registered trademark of Robert McNeel & Associates.
THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED WARRANTY. ALL IMPLIED WARRANTIES OF FITNESS FOR ANY PARTICULAR PURPOSE AND OF MERCHANTABILITY ARE HEREBY DISCLAIMED.
For complete Rhino SDK copyright information see http://www.rhino3d.com/developer. This works a lot like CRhinoGetPoint. but instead of a line, it draws a rectangle for dynamic feedback Caller can use CRhinoGetPoint::Constrain( ON_Plane), CRhinoGetPoint::ConstrainToConstructionPlane(), CRhinoGetPoint::SetBasePoint( ON_3dPoint) to supply a context for the rectangle Use CRhinoGetPoint::GetPoint() to get the far corner of a rectangle based at the BasePoint or construction plane origin Use Corners( ON_3dPoint rect[4]) to get the results
CRhinoGetRectangle::CRhinoGetRectangle | ( | CArgsRhinoGetPlane & | ) |
CRhinoGetRectangle::~CRhinoGetRectangle | ( | ) |
|
protected |
not implemented
|
protected |
BOOL32 CRhinoGetRectangle::Corners | ( | ON_3dPoint | rect[4] | ) | const |
Description: Use GetCorners() to fill in rect with the 3d corners of the rectangle Parameters: rect [in] an unused array to store the output corners if GetRectangle() returns point Returns: @untitled table TRUE Success False Failure
|
overrideprotectedvirtual |
STEP 5a: Optional - override CRhinoGetPoint::DynamicDraw() if you want to dynamically draw things as the mouse/digitizer moves. Every time the mouse moves, DynamicDraw() will be called once per viewport. The calls to DynamicDraw() happen AFTER the call to OnMouseMove().
Use the CRhinoView::Draw* tools to draw things. Use Rhino::LayerColor(), etc., to get Rhino system colors.
If you are drawing anything that takes a long time, periodically call InterruptMouseMove() to see if you should stop.
If you override both OnMouseMove() and DynamicDraw(), then every time the mouse moves you will first get a single call to OnMouseMove() and then get a call to DynamicDraw() for each viewport.
If you override dynamic draw, you should call CRhinoGetPoint::DynamicDraw() at the end of your override.
Reimplemented from CRhinoGetPoint.
std::function<void(const ON_3dPoint[4])> CRhinoGetRectangle::DynamicRectangleCallback | ( | ) | const |
Description: Set or get the length or width of the rectangle if they were typed in instead of picking a corner Parameters: length [in] - length to set width [in] - width to set Returns: the typed length or width void SetLength( double length); double Length() const; void SetWidth( double width); Description: Get callback function for doing custom dynamic drawing Returns: Callback function Remarks: Good for custom drawing when calling RhinoGetRectangle
CRhinoGet::result CRhinoGetRectangle::GetRectangle | ( | CRhinoHistory * | history | ) |
Description: Do the interactive point getting Parameters: history [in] pointer to a CRhinoHistory record Returns: CRhinoGet::result Remarks: Derived from CRhinoGetPoint. Use any CRhinoGetPoint options/set-up functions See CRhinoGetPoint for return values
|
overrideprotectedvirtual |
STEP 4: Optional - override CRhinoGetPoint::OnMouseMove() Description: If you want to be called every time the mouse moves, override this function. Parameters: vp - [in] active view nFlags - [in] standard windows OnMouseMove event flags point - [in] 3d world location ( May be uninitialized) view_wnd_point - [in] If the point is coming from a "mouse" pointing device, view_wnd_point is the CRhinoView window coordinates of mouse location. If the point is coming from a 3d digitizer pointing device, view_wnd_point is NULL. Remarks: CRhinoGetPoint::OnMouseMove is called once per mouse move and is called BEFORE any calls to CRhinoGetPoint::OnDynamicDraw. If you are doing anything that takes a long time, periodically call InterruptMouseMove() to see if you should stop. If the view is such that the 2d screen point can't be mapped to a 3d point, the 'point' argument will be ON_unset_point
Reimplemented from CRhinoGetPoint.
|
protected |
void CRhinoGetRectangle::SetDynamicRectangleCallback | ( | std::function< void(const ON_3dPoint[4])> | callback | ) |
Description: Set callback function for doing custom dynamic drawing Parameters: callback [in] Callback function for dynamic drawing Remarks: Good for custom drawing when calling RhinoGetRectangle
|
protected |
[i/o] access to arguments
|
protected |
for dynamic drawing
|
protected |
[in] color to use when drawing dynamic line while getting end point
|
protected |
callback for dynamic drawing
|
protected |
[in] prompt when getting end point