ut_transform.c File Reference
geom. Transformations UTRA_
More...
#include "MS_Def0.h"
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "../ut/ut_geo.h"
#include "../ut/ut_TX.h"
#include "../db/ut_DB.h"
#include "../gr/ut_UI.h"
Defines |
| #define | TRA_TAB_SIZ 10 |
Functions |
| int | UTRA_app_pt (Point *, Point *) |
| int | UTRA_app_vc (Vector *, Vector *) |
| int | UTRA_def__ (int trNr, int typ, void *data) |
| int | UTRA_nobj_tra (ObjGX *oao, int oNr, ObjGX *oai, Memspc *objSeg, Memspc *tmpSeg) |
| int | UTRA_app_obj (void *objo, int *oSiz, void *obji, Memspc *wrkSpc) |
| int | UTRA_app_oTab (void *objo, int *oSiz, void *obji, Memspc *wrkSpc) |
| int | UTRA_app_s (long *ind, int *typ, Memspc *wrkSpc) |
| int | UTRA_app__ (void *objo, int *oSiz, int otyp, int iNr, void *obji, Memspc *wrkSpc) |
| int | UTRA_app_pt2 (Point2 *p2, Point2 *p1) |
| int | UTRA_tra_pt2 (Point2 *p2, Point2 *p1, int typ, TraRot *tra) |
| int | UTRA_tra_pt (Point *p2, Point *p1, int typ, TraRot *tra) |
| int | UTRA_tra_vc (Vector *v2, Vector *v1, int typ, TraRot *tra) |
| int | UTRA_m3_iniZrot (TraRot *tr1, Point *ptOri, double ar) |
| int | UTRA_m3_inirot (TraRot *tr1, Point *pa, Vector *va, double ar) |
| void | UTRA_m3_multm3 (Mat_4x3 m3, Mat_4x3 ma, Mat_4x3 mb) |
Variables |
| static int | TRA_NR = 0 |
| static int | TRA_TYP [TRA_TAB_SIZ] |
| static TraRot | TRA_TAB [TRA_TAB_SIZ] |
Detailed Description
geom. Transformations UTRA_
=====================================================
Liste_Funktionen_Beginn:
UTRA_def__ define transformation
UTRA_nobj_tra apply transf. to ObjGX-Table
UTRA_app__ apply transf. to struct (nicht ObjGX)
UTRA_app_obj apply transf. to object (ObjGX-tree)
UTRA_app_oTab apply transf. to ObjGX-table
UTRA_app_pt apply all defined Transformations to a point
UTRA_app_pt2 apply all defined Transformations to a 2D-point
UTRA_app_vc apply all defined Transformations to a vector
UTRA_tra_pt apply a single Transformation to a point
UTRA_tra_pt2 apply a single Transformation to a 2D-point
UTRA_tra_vc apply a single Transformation to a vector
UTRA_m3_inirot define rotation um eine freie Achse
UTRA_m3_iniZrot Drehung um die Z-Achse definieren
UT3D_m3_multm3 der Nutzen ist unbekannt ....
Liste_Funktionen_Ende:
=====================================================
- see also:
UT3D_m3_load
UT3D_m3_load_o
UT3D_m3_get
UT3D_m3_multm3
--------------------------------------------------------
Mat_4x3:
VX VY VZ Nullpunkt
[0][0]=vx.dx [0][1]=vy.dx [0][2]=vz.dx [0][3]=o.x
[1][0]=vx.dy [1][1]=vy.dy [1][2]=vz.dy [1][3]=o.y
[2][0]=vx.dz [2][1]=vy.dz [2][2]=vz.dz [2][3]=o.z
--------------------------------------------------------
- usage examples:
UT3D_vc_3db (&vc1, 15.,0.,5.);
UTRA_def__ (1, Typ_VC, &vc1);
UTRA_app__ ..
UTRA_m3_iniZrot (&tr1, &ptc, UT_RADIANS(45.));
UTRA_def__ (1, Typ_TraRot, &tr1);
UTRA_app__ ..
TraRot tr1;
UTRA_m3_inirot (&tr1, &pt0, &vc0, UT_RADIANS(30.));
UTRA_def__ (1, Typ_TraRot, &tr1);
UTRA_app__ ..
UT3D_m3_loadpl (m1, pl1);
UT3D_m3_invm3 (mi1, m1);
UTRA_def__ (1, Typ_TraMat, mi1);
UTRA_app__ (datSpc1, .. Typ_LN, ln2, NULL);
char auxObj[OBJ_SIZ_MAX];
oSiz = OBJ_SIZ_MAX;
UME_init (&wrk1Spc, memspc101, sizeof(memspc101));
irc = UTRA_app__ (auxObj, &oSiz, Typ_LN, 1, &ln1, &wrk1Spc);
if(translate == ON) {
UME_init (&wrk1Spc, memspc101, sizeof(memspc101));
ox2 = (ObjGX*)memspc102;
oSiz = sizeof(memspc102);
irc = UTRA_app_obj (ox2, &oSiz, ox1, wrk1Spc);
if(irc < 0) continue;
ox1 = (ObjGX*)memspc102;
}
Define Documentation
Function Documentation
apply all defined Transformations to a point.
apply all defined Transformations to a Vector.
| int UTRA_def__ |
( |
int |
trNr, |
|
|
int |
typ, |
|
|
void * |
data | |
|
) |
| | |
| int UTRA_nobj_tra |
( |
ObjGX * |
oao, |
|
|
int |
oNr, |
|
|
ObjGX * |
oai, |
|
|
Memspc * |
objSeg, |
|
|
Memspc * |
tmpSeg | |
|
) |
| | |
| int UTRA_app_obj |
( |
void * |
objo, |
|
|
int * |
oSiz, |
|
|
void * |
obji, |
|
|
Memspc * |
wrkSpc | |
|
) |
| | |
apply Tranfsormation to struct or object.
init Transformation mit UTRA_def__ erforderlich !!!
Storage:
Normale structs werden nach objo ausgegeben;
ObjGX-Records: ObjGX-Records werden nach objo ausgegeben; die
zugehoerigen Daten (structs) werden in wrkSpc gespeichert.
Input:
oSiz size of objo; wird recursiv verkleinert !
obji (ObjGX*) (NUR (ObjGX*) moeglich !)
Output:
oSiz freier Restplatz in objo
wrkSpc fuer Daten (structs) von oGX-Objekten
see UTO_stru_tra oder UTO_obj_tra
| int UTRA_app_oTab |
( |
void * |
objo, |
|
|
int * |
oSiz, |
|
|
void * |
obji, |
|
|
Memspc * |
wrkSpc | |
|
) |
| | |
einen oGX-Block resolven
Input:
obji parentRecord (ObjGX-Record) dessen form ebenfalls oGX ist
see DB_store_obj
| int UTRA_app_s |
( |
long * |
ind, |
|
|
int * |
typ, |
|
|
Memspc * |
wrkSpc | |
|
) |
| | |
copy & transform DB-object typ/ind
Transformiert objekte die innerhalb einer struct auftreten;
zB Axis und Konturobjekt in einer SurRev-struct.
Output:
ind DB-index of new obj (dyn.obj!)
| int UTRA_app__ |
( |
void * |
objo, |
|
|
int * |
oSiz, |
|
|
int |
otyp, |
|
|
int |
iNr, |
|
|
void * |
obji, |
|
|
Memspc * |
wrkSpc | |
|
) |
| | |
apply Tranfsormation to struct; NOT object.
init Transformation with UTRA_def__
Storage:
Normale structs werden nach objo ausgegeben;
ObjGX-Records: ObjGX-Records werden nach objo ausgegeben; die
zugehoerigen Daten (structs) werden in wrkSpc gespeichert.
Input:
oSiz size of objo; wird recursiv verkleinert !
otyp form of obji; muss also bei Surface auch Typ_ObjGX sein !
iNr Anzahl structs to transform
Output:
oSiz freier Restplatz in objo
wrkSpc fuer Daten (structs) von oGX-Objekten; kann f. structs NULL sein
see UTO_stru_tra oder UTO_obj_tra
apply all defined Transformations to a 2D-point.
apply a single Transformation to a 2D-point.
see also UT3D_pt_traptm3 UTRA_pt_traptm3
apply a single Transformation to a point.
see also UT3D_pt_traptm3 UTRA_pt_traptm3
apply a single Transformation to a Vector.
| int UTRA_m3_iniZrot |
( |
TraRot * |
tr1, |
|
|
Point * |
ptOri, |
|
|
double |
ar | |
|
) |
| | |
Drehung um die Z-Achse definieren
ptOri ist ein Punkt, um den gedreht werden soll.
Drehung um absolute Z-Achse oder obj schon in NullLage: ptOri=NULL.
transformation from rotationaxis (pa, va) and angle (ar)
UT3D_m3_multm3 4x3-Matrix mit 4x3 Matrix multiplizieren (nur den 3x3-Anteil)
Variable Documentation