SpaceArrayCallback Class Reference

SpaceArrayCallback Class Reference

#include <spacearraycallback.h>

Class Description

See also
Class Interface, Class ShapeObject, Class Spline3D, Class Point3.

Description:
This is the callback object for the method Interface::DoSpaceArrayDialog(SpaceArrayCallback *sacb=NULL)=0

This is the method which brings up the Spacing tool. This lets the user distribute objects based on the current selection along a path defined by a spline or a pair of points.

The callback is mostly for use for plug-ins that need to use the spacing tool as a way of generating spacing information. If one wants to customize the default behaviour of the dialog, they derive a class from this one and implement the virtual methods. The non-virtuals simply provide access to the spacing information. This is both for setting the defaults before calling the spacing tool as well as getting out the information after using the spacing tool.
+ Inheritance diagram for SpaceArrayCallback:

Public Member Functions

 SpaceArrayCallback ()
 
 SpaceArrayCallback (SpaceArrayCallback const &other)
 
virtual ~SpaceArrayCallback ()
 
CoreExport SpaceArrayCallbackoperator= (const SpaceArrayCallback &other)
 
virtual bool isModal (void)
 
virtual bool doPickPath (void)
 
virtual const MCHARdialogTitle (void)
 
virtual const MCHARstartMessage (void)
 
virtual const MCHARbuttonText (void)
 
virtual bool isSilent (void)
 
virtual bool doObjectType (void)
 
virtual void proc (void)
 
ShapeObjectgetPath (void)
 
void setPath (ShapeObject *p)
 
CoreExport void setPath (Point3 pt1, Point3 pt2)
 
CoreExport void setPath (Spline3D *s)
 
float getStart (void)
 
float getEnd (void)
 
float getSpace (void)
 
int getCount (void)
 
int getContext (void)
 
float getWidth (void)
 
void setStart (float f)
 
void setEnd (float f)
 
void setSpace (float f)
 
void setCount (int n)
 
bool getFollow (void)
 
void setFollow (bool t)
 
void setContext (CTYPE c)
 
OTYPE getObjectCreationType (void)
 
void setObjectCreationType (OTYPE t)
 
STYPE getSpacingType (void)
 
void setSpacingType (STYPE s)
 
CoreExport void setMessage (const MCHAR *buf)
 
void setWidth (float nWidth)
 
void setCountLimit (int limit)
 
int getCountLimit (void)
 

Additional Inherited Members

- Static Public Member Functions inherited from MaxHeapOperators
static UtilExport voidoperator new (size_t size)
 Standard new operator used to allocate objects If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new (size_t size, const std::nothrow_t &e)
 Standard new operator used to allocate objects if there is insufficient memory, NULL will be returned. More...
 
static UtilExport voidoperator new (size_t size, const char *filename, int line)
 New operator used to allocate objects that takes the filename and line number where the new was called If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new (size_t size, int block_type, const char *filename, int line)
 New operator used to allocate objects that takes the type of memory, filename and line number where the new was called If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new (size_t size, const std::nothrow_t &e, const char *filename, int line)
 New operator used to allocate objects that takes the filename and line number where the new was called If there is insufficient memory, NULL will be returned. More...
 
static UtilExport voidoperator new (size_t size, unsigned long flags)
 New operator used to allocate objects that takes extra flags to specify special operations If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new (size_t size, const std::nothrow_t &e, unsigned long flags)
 New operator used to allocate objects that takes extra flags to specify special operations If there is insufficient memory, NULL will be returned. More...
 
static UtilExport voidoperator new[] (size_t size)
 New operator used to allocate arrays of objects If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new[] (size_t size, const std::nothrow_t &e)
 New operator used to allocate arrays of objects If there is insufficient memory, NULL will be returned. More...
 
static UtilExport voidoperator new[] (size_t size, const char *filename, int line)
 New operator used to allocate arrays of objects If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new[] (size_t size, int block_type, const char *filename, int line)
 New operator used to allocate arrays of objects. More...
 
static UtilExport voidoperator new[] (size_t size, const std::nothrow_t &e, const char *filename, int line)
 New operator used to allocate arrays of objects If there is insufficient memory, NULL will be returned. More...
 
static UtilExport voidoperator new[] (size_t size, unsigned long flags)
 New operator used to allocate arrays of objects If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new[] (size_t size, const std::nothrow_t &e, unsigned long flags)
 New operator used to allocate arrays of objects If there is insufficient memory, NULL will be returned. More...
 
static UtilExport void operator delete (void *ptr)
 Standard delete operator used to deallocate an object If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete (void *ptr, const std::nothrow_t &e)
 Standard delete operator used to deallocate an object If the pointer is invalid, nothing will happen. More...
 
static UtilExport void operator delete (void *ptr, const char *filename, int line)
 Delete operator used to deallocate an object that takes the filename and line number where the delete was called If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete (void *ptr, int block_type, const char *filename, int line)
 Delete operator used to deallocate an object that takes the type of memory, filename and line number where the delete was called If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete (void *ptr, const std::nothrow_t &e, const char *filename, int line)
 Delete operator used to deallocate an object that takes the filename and line number where the delete was called If the pointer is invalid, nothing will happen. More...
 
static UtilExport void operator delete (void *ptr, unsigned long flags)
 Delete operator used to deallocate an object that takes extra flags to specify special operations If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete (void *ptr, const std::nothrow_t &e, unsigned long flags)
 Delete operator used to deallocate an object that takes extra flags to specify special operations If the pointer is invalid, nothing will happen. More...
 
static UtilExport void operator delete[] (void *ptr)
 Standard delete operator used to deallocate an array of objects If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete[] (void *ptr, const std::nothrow_t &e)
 Standard delete operator used to deallocate an array of objects If the pointer is invalid, nothing will happen. More...
 
static UtilExport void operator delete[] (void *ptr, const char *filename, int line)
 Delete operator used to deallocate an array of objects that takes the filename and line number where the delete was called If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete[] (void *ptr, int block_type, const char *filename, int line)
 Delete operator used to deallocate an array of objects that takes the type of memory, filename and line number where the delete was called If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete[] (void *ptr, const std::nothrow_t &e, const char *filename, int line)
 Delete operator used to deallocate an array of objects that takes the filename and line number where the delete was called If the pointer is invalid, nothing will happen. More...
 
static UtilExport void operator delete[] (void *ptr, unsigned long flags)
 Delete operator used to deallocate an array of objects that takes extra flags to specify special operations If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete[] (void *ptr, const std::nothrow_t &e, unsigned long flags)
 Delete operator used to deallocate an array of objects that takes extra flags to specify special operations If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport voidoperator new (size_t size, void *placement_ptr)
 Placement new operator. More...
 
static UtilExport void operator delete (void *ptr, void *placement_ptr)
 Placement delete operator. More...
 
static UtilExport voidaligned_malloc (size_t size, size_t alignment)
 Allocates memory on a specified alignment boundary. More...
 
static UtilExport voidaligned_realloc (void *ptr, size_t size, size_t alignment)
 Reallocates memory on a specified alignment boundary. More...
 
static UtilExport void aligned_free (void *ptr)
 Frees a block of memory that was allocated with aligned_malloc/aligned_realloc. More...
 

Constructor & Destructor Documentation

SpaceArrayCallback ( )
inline
Remarks
Constructor. The data members are initialized as follows:

path = NULL; start = end = space = 0.0f; count = 1; oType = NODE_CPY; sType = SPACE_CENTER; follow = false; context = CTXT_FREE; width = 0.0f; countLimit = INT_MAX;
83  {
84  start = end = space = 0.0f; count = 1; oType = NODE_CPY; sType = SPACE_CENTER; follow = false;
85  context = CTXT_FREE; width = 0.0f; countLimit = INT_MAX;
86  }
Definition: spacearraycallback.h:36
Definition: spacearraycallback.h:37
Definition: spacearraycallback.h:35
SpaceArrayCallback ( SpaceArrayCallback const &  other)
inline
89  {
90  *this = other;
91  }
virtual ~SpaceArrayCallback ( )
inlinevirtual
Remarks
Destructor.
94 {}

Member Function Documentation

CoreExport SpaceArrayCallback& operator= ( const SpaceArrayCallback other)
virtual bool isModal ( void  )
inlinevirtual
Remarks
Implemented by the Plug-in.

If this method returns false, the dialog is presented as a modeless dialog.
Default Implementation:
{ return true; }
102 { return true; }
virtual bool doPickPath ( void  )
inlinevirtual
Remarks
Implemented by the Plug-in.

If this method returns true, the path picking buttons are turned on.
Default Implementation:
{ return false; }
107 { return false; }
virtual const MCHAR* dialogTitle ( void  )
inlinevirtual
Remarks
Implemented by the Plug-in.

Returns the title for the dialog (e.g. Space Array Tool).
Default Implementation:
{ return _M(""); }
112 { return _M(""); }
#define _M(x)
Used to wrap string literals.
Definition: strbasic.h:67
virtual const MCHAR* startMessage ( void  )
inlinevirtual
Remarks
Implemented by the Plug-in.

Returns the message to be displayed in the static display right after the dialog comes up.
Default Implementation:
{ return _M(""); }
118 { return _M(""); }
#define _M(x)
Used to wrap string literals.
Definition: strbasic.h:67
virtual const MCHAR* buttonText ( void  )
inlinevirtual
Remarks
Implemented by the Plug-in.

Returns the button text.
Default Implementation:
{ return _M("OK"); }
123 { return _M("OK"); }
#define _M(x)
Used to wrap string literals.
Definition: strbasic.h:67
virtual bool isSilent ( void  )
inlinevirtual
Remarks
Implemented by the Plug-in.

If this method returns true, the spacing tool generates points, but the actual dialog is not presented to the user. This is currently used, for example, by the Stairs in VIZ to generate spacing information for the mesh.
Default Implementation:
{ return false; }
130 { return false; }
virtual bool doObjectType ( void  )
inlinevirtual
Remarks
Implemented by the Plug-in.

If this method returns false, then the Instance, Copy, Reference radio buttons are disabled (greyed out).
Default Implementation:
{ return true; }
136 { return true; }
virtual void proc ( void  )
inlinevirtual
Remarks
Implemented by the Plug-in.

This method is called after the spacing information is generated. It is here that a developer using this callback could get the updated values, perform some calculation of their own, etc.
Default Implementation:
{}
143 {}
ShapeObject* getPath ( void  )
inline
Remarks
Implemented by the System.

Returns a pointer to the path ShapeObject.
148 { return (ShapeObject*)path.GetRef(); }
CoreExport RefTargetHandle GetRef() const
Get the Reference.
ShapeObjects are open or closed hierarchical shapes made up of one or more pieces.
Definition: object.h:4475
void setPath ( ShapeObject p)
inline
Remarks
Implemented by the System.

Sets the path used (as a ShapeObject).
Parameters:
ShapeObject *p

Points to the shape object to use as a path.
154 { path.SetRef(p); }
CoreExport void SetRef(RefTargetHandle rt)
Set the Reference.
CoreExport void setPath ( Point3  pt1,
Point3  pt2 
)
Remarks
Implemented by the System.

Sets the points for the path.
Parameters:
Point3 pt1

One of the endpoints.

Point3 pt2

The other endpoint.
CoreExport void setPath ( Spline3D s)
Remarks
Implemented by the System.

Sets the path used.
Parameters:
Spline3D *s

Points to the path to use.
float getStart ( void  )
inline
Remarks
Implemented by the System.

Returns the start offset.
171 { return start; }
float getEnd ( void  )
inline
Remarks
Implemented by the System.

Returns the end offset.
174 { return end; }
float getSpace ( void  )
inline
Remarks
Implemented by the System.

Returns the spacing.
177 { return space; }
int getCount ( void  )
inline
Remarks
Implemented by the System.

Returns the object count.
180 { return count; }
int getContext ( void  )
inline
Remarks
Implemented by the System.

Returns the context. See setContext() above.
183 { return context; }
float getWidth ( void  )
inline
Remarks
Implemented by the System.

Returns the width. This is the width of the object to be arrayed. It is a single value so can be calculated any way the user wishes. In the default spacing tool this is calculated based on the x size of the bounding box.
188 { return width; }
void setStart ( float  f)
inline
Remarks
Implemented by the System.

Sets the start offset.
Parameters:
float f

The start offset to set.
194 { start = f; }
void setEnd ( float  f)
inline
Remarks
Implemented by the System.

Sets the end offset.
Parameters:
float f

The end offset to set.
200 { end = f; }
void setSpace ( float  f)
inline
Remarks
Implemented by the System.

Sets the spacing.
Parameters:
float f

The spacing to set.
206 { space = f; }
void setCount ( int  n)
inline
Remarks
Implemented by the System.

Sets the count.
Parameters:
int n

The count to set.
212 { count = n > countLimit ? countLimit : n; }
bool getFollow ( void  )
inline
Remarks
Implemented by the System.

Returns true if Follow is set (checked); otherwise false.
215 { return follow; }
void setFollow ( bool  t)
inline
Remarks
Implemented by the System.

Sets the Follow state (checkbox).
Parameters:
bool t

Use true for checked; false for un-checked.
221 { follow = t; }
void setContext ( CTYPE  c)
inline
Remarks
Implemented by the System.

Sets the context.
Parameters:
CTYPE c

One of the following values:

CTXT_FREE - Free Center

CTXT_CNTRCOUNT - Divide Evenly, Objects at Ends

CTXT_CNTRSPACE - Centered, Specify Spacing

CTXT_END - End Offset

CTXT_ENDCOUNT - End Offset, Divide Evenly

CTXT_ENDSPACE - End Offset, Specify Spacing

CTXT_START - Start Offset

CTXT_STARTCOUNT - Start Offset, Divide Evenly

CTXT_STARTSPACE - Start Offset, Specify Spacing

CTXT_FULLSPACE - Specify Offset and Spacing

CTXT_FULLCOUNT - Specify Offsets, Divide Evenly

CTXT_ENDLOCK - Space from End, Unbounded

CTXT_ENDLOCKCOUNT - Space from End, Specify Number

CTXT_ENDLOCKSPACE - Space from End, Specify Spacing

CTXT_STARTLOCK - Space from Start, Unbounded

CTXT_STARTLOCKCOUNT - Space from Start, Specify Number

CTXT_STARTLOCKSPACE - Space from Start, Specify Spacing

CTXT_FULLLOCKSPACE - Specify Spacing, Matching Offsets

CTXT_FULLLOCKCOUNT - Divide Evenly, No Objects at Ends
246 { context = c; }
OTYPE getObjectCreationType ( void  )
inline
Remarks
Implemented by the System.

Returns the object creation type. One of the following values:

NODE_CPY – Copy

NODE_INST – Instance

NODE_REF – Reference
252 { return oType; }
void setObjectCreationType ( OTYPE  t)
inline
Remarks
Implemented by the System.

Sets the object creation type. One of the following values:

NODE_CPY – Copy

NODE_INST – Instance

NODE_REF – Reference
258 { oType = t; }
STYPE getSpacingType ( void  )
inline
Remarks
Implemented by the System.

Returns the spacing type. One of the following values:

SPACE_CENTER

SPACE_EDGE
263 { return sType; }
void setSpacingType ( STYPE  s)
inline
Remarks
Implemented by the System.

Sets the spacing type.
Parameters:
STYPE s

One of the following values:

SPACE_CENTER

SPACE_EDGE
271 { sType = s; }
CoreExport void setMessage ( const MCHAR buf)
Remarks
Implemented by the System.

Sets the message string.
void setWidth ( float  nWidth)
inline
Remarks
Implemented by the System.

Sets the width. See getWidth() above.
Parameters:
float nWidth

The width to set.
280 { width = nWidth; }
void setCountLimit ( int  limit)
inline
Remarks
Implemented by the System.

Sets a limit on the count.
Parameters:
int limit

The limit to set.
286 { countLimit = limit; }
int getCountLimit ( void  )
inline
Remarks
Implemented by the System.

Returns the limit on the count.
289 { return countLimit; }