SilverScreen Solid Modeler

tm_transform_bos

tm_transform_bos

Previous topic Next topic  

tm_transform_bos

Previous topic Next topic JavaScript is required for the print function  

SilverScreenAPI

 

void tm_transform_bos ( BOS_NODE *bos, MATRIX tm )

 

BOS_NODE *bos;       // pointer to block, object or symbol

MATRIX    tm;        // transformation matrix

 

 




Synopsis

#include "ssnodes.h"

 

The tm_transform_bos function converts the block, object, symbol, or text node pointed to by bos into the coordinate system specified by tm.

 

 

Parameters

bos is a pointer to a SilverScreen block, object or symbol, as obtainable by a call to get_bos. tm is the address of a 4x4 array of doubles.

 

 

Return Value

none.

 

 

See Also

get_bos

 

 

Example

The following example illustrates how this can be used to “flatten” or “project” a drawing onto the current construction space:

C / C++ Code

 

 #include "silver.h"

 #include "ssnodes.h"

 

 main()

 {

 BOS_NODE *root;

 MATRIX   tm;

 

 if ( ! (root = (BOS_NODE *) get_bos ( "\\" )) ||

      ! ((BLOCK_NODE *) root)->first_bos )

    {

    error_message ( "This function requires a drawing" );

    exit(0);

    }

 

 cv_set (CV_VERY_QUIET, 1);

 

 ss_command ( "c-space align view" );

 ss_command ( "silent view project parallel" );

 ss_command ( "zoom drawing" );

 ss_command ( "note The drawing will now be flattened" );

 

 // Get the current C-space

 tm_cspace ( tm );

 // Apply projection operation

 tm_scale_z ( 0.0, tm );

 // Apply matrix to drawing

 tm_transform_bos ( root, tm );

 

 ss_command ( "silent view select face front" );

 ss_command ( "window zoom drawing" );

 

 cv_set (CV_VERY_QUIET, 0);

 }