bend_law
List of: Classes
Subjects: Laws, SAT Save and Restore
Contents: Laws

Purpose: Creates a law to bend from a position around an axis in a given direction a specified amount.

Derivation: bend_law : multiple_law : law : ACIS_OBJECT : -

SAT Identifier: "BEND"

Filename: law/lawutil/main_law.hxx

Description: Creates a law to bend from a position around an axis in a given direction a specified amount.

References: LAW law

Constructor: public: bend_law::bend_law (


law** in_sublaw, // array of sublaws


int in_size // size of array


);


C++ constructor, creating a law. This sets the use_count to 1 and increments the how_many_laws. It sets dlaw, slaw, and lawdomain to NULL.






public: bend_law::bend_law (


SPAposition root, // root position


SPAunit_vector axis, // axis


SPAunit_vector dir, // direction for bend


double r // distance


);


C++ constructor, creating a law. This sets the use_count to 1 and increments the how_many_laws. It sets dlaw, slaw, and lawdomain to NULL.




Destructor: public: bend_law::~bend_law ();


C++ destructor, deleting a bend_law.



Methods: public: char const* bend_law::class_name ();


This method returns a string that contains the name of this class. It is provided as a user-friendly interface to laws.






public: int bend_law::date () const;


Returns the version of ACIS that the law was added in. If a law is part of a model that is to be saved at a previous ACIS release level, this is used to indicated whether the law can be saved or not.






protected: law* bend_law::deriv (


int which // variable to take




// derivative with




// respect to



= 0 // default value (X




// or A1)


) const;


This method returns a law pointer that is the derivative of the given law with respect to the which variable. Variables in C++ are numbered starting at zero (0). The default is to take a derivative with respect to the first variable, which in a law function string is A1 or X. The variables X, Y, and Z are equivalent to the indices 0, 1, and 2, respectively.


The deriv method should not called directly by applications. It is called by the derivative method, which is inherited by all classes derived from law. All classes derived from law (or its children) must implement their own deriv method to perform the actual derivative calculation when called by derivative.






public: void bend_law::evaluate (


double const* x, // pointer to values




// used in evaluation


double* answer // multi-dimension answer




// range for evaluation


) const;


This method takes two pointers to memory that the caller is responsible for creating and freeing. The x argument tells where to evaluate the law. This can be more than one dimension. The answer argument returns the evaluation. This can be more than one dimension. x should be the size returned by the take_dim method, and answer should be the size returned by the return_dim method. All derived law classes must have this method or inherit it. This does no checking of the dimension of input and output arguments. It is preferable to call a more specific evaluator if possible.






public: static int bend_law::id ();


This method should not be called directly by the application. All derived law classes must have this method. The isa, id, and and type methods are used to identify a law's class type.






public: logical bend_law::isa (


int t // id method return


) const;


All derived law classes must have this method. The isa, id, and and type methods are used to identify a law's class type. The methods should be the same for all law classes with the exception of the isa method that calls the isa method of its parent class. To test to see if a law is a given type, use test_law->isa(constant_law::id()). If test_law is a constant_law or is derived from the constant_law class, this returns TRUE.






public: multiple_law* bend_law::make_one (


law** in_datas, // array of law data


int in_size // size of array


) const;


Returns a pointer to a law of this type. Used by parsing to create an instance of this law.






public: int bend_law::return_size () const;


The return_size tells how many values are returned in the answer argument of the evaluate method. The default is 1. All derived law classes must have this method or inherit it.






protected: law* bend_law::sub_inverse () const;


Returns a pointer to the sublaws that are used to make up the inverse law of this class.






public: virtual law* bend_law::sub_simplify (


int level = 0,
//


char const*& what = *
//



(char const** )NULL_REF //


) const;


This is a member function that may be overloaded by classes to provide assistance to the simplifier. It helps the simplifier in dealing with this particular law.


An example is that a curve law applied to a line or ellipse can return an equation in the form of a law. The sub_simplify method can then access and private members of the curve law that the simplifier does not have access to. Most laws simply inherit a function that returns null.






public: char const* bend_law::symbol (


law_symbol_type type // type of law symbol



= DEFAULT // standard ACIS type


) const;


Returns the string that represents this law class's symbol. The symbol is used for parsing the law and for saving and restoring law-based geometry. For a law to be saved and restored, it must have or inherit this method.


This is the top-level class. The default law symbol for this class is an error message. Derived classes need to define their own symbol methods to override this error message.






public: int bend_law::take_size () const;


Returns the dimension of the law's domain (input). The default is 1. All derived law classes must have this method or inherit it.






public: int bend_law::type () const;


All derived law classes must have this method. The isa, id, and and type methods are used to identify a law's class type. The methods should be the same for all law classes.

Internal Use: full_size, hasa




Related Fncs: initialize_law, terminate_law
PDF/LAW/03CLA.PDF
HTM/DATA/LAW/LAW/03CLA/0006.HTM