/
3d Constraint API Dorlig Na 3d Constraint API Dorlig Na

3d Constraint API Dorlig Na - PowerPoint Presentation

LovableLatina
LovableLatina . @LovableLatina
Follow
342 views
Uploaded On 2022-08-01

3d Constraint API Dorlig Na - PPT Presentation

Contents Constraint3dSolver Constraint3dBase and all kind of 3d constraints GeometryId and all its sub classes which represent kinds of sub entity of a curve or a solid to be constrained Constraint3dElement ID: 931447

constraints constraint model element constraint constraints element model create type constraint3delement constrained amp solid class methods geometryid data eeh

Share:

Link:

Embed:

Download Presentation from below link

Download Presentation The PPT/PDF document "3d Constraint API Dorlig Na" is the property of its rightful owner. Permission is granted to download and print the materials on this web site for personal, non-commercial use only, and to display it on your personal computer provided you do not modify the materials and that you retain all copyright notices contained in the materials. By downloading content from our website, you accept the terms of this agreement.


Presentation Transcript

Slide1

3d Constraint API

Dorlig Na

Slide2

Contents

Constraint3dSolver

Constraint3dBase and all kind of 3d constraints

GeometryId

and all its sub classes which represent kinds of sub entity of a curve or a solid to be constrained.

Constraint3dElement

3d constraints model, and how to merge different model into one.

A complete example

Header files

Note: there are two concepts which should be clarified

Constraint element means a 106 type element which is used to contain a constraints model/data.

2

. Constrained

element means a curve or solid element sub entities of which are to

be constrained

.

Slide3

Constraint3dSolver

Unlike 2d constraint, there is no class represent a 3d constraint model, you just use a constraint vector to initialize a Constraint3dSolver which will evaluate the constraints

Slide4

Constraint3dSolver

- most important methods

Initialize (

T_Constraints

const& constraints,

DgnModelRefR

modelRef

,

bmap

<

ElementRefP

,

EditElementHandleP

>*

modifiedElements

=

NULL

, char const*

debugJournal

=

NULL

);

constraints //a

bvector

<Constraint3dPtr> indeed represent all constraints you want to evaluate.

modelRef

//

dgn

model which contains the constraints and the constrained elements

Evaluate (

T_ElementTransformMap

&

transformMap

);

transformMap

// evaluation result that give transforms for each constrained element which will be used to update the elements positions.

Slide5

Constraint3dBase – base class of all kind of constraint

Slide6

Constraint3dBase – most important methods

static Constraint3dPtr Create (Constraint3dType type);

factory method to create a type of constraint

type // specify the type of the constraint you want to create

SetGeometryIds

(

T_GeometryIds

const&

geometryIds

)

geometryIds

//

bvector

<

GeometryIdPtr

> indeed which specify the sub geometries you want to constrain.

bvector

size may be 1, 2 or 3 depending on the constraint type

Slide7

GeometryId

– base class of all kind of sub geometries of a curve vector or a solid

Slide8

struct FaceGeometryId

:

GeometryId

-

a concrete class for example

Any concrete class has a factory method Create to create a

GeometryId

object of its specific type.

//

FaceGeometryId’s

factory method

static

GeometryIdPtr

Create (

ElementHandleCR

eh,

ISubEntityCR subEntity);eh // handle of a solid elementsubEntity // type is an interface class of Dgnplatform lib which represents a sub entity, such as solid vertex, edge or face.

Slide9

Constraint3dElement – most important methods

GetHostElement

(

EditElementHandleR

hostEeh

,

ElementHandleCR

eh, bool

searchGroup

= false);

hostEeh

// return a 106 element which the whole constraint model data is saved in

eh, any constrained element in a constrains model

GetExistingConstraints

(

T_StdElementRefSet& hosts, T_Constraints& constraints, T_StdElementRefSet& elementRefs, DgnModelRefP modelRef, bool doGroups)

hosts // return 106 elements each contains a separate constraint model data, the size of the set depends on whether the

elementRefs

is all from one constraint model or not

elementRefs

// generally pass in the elements you just want to add a new constraint on.

Slide10

Constraint3dElement::

GetExistingConstraints

– the usage of it

Slide11

Constraint3dElement – more important methods

static

BentleyStatus

Create (

EditElementHandleR

eeh

,

DgnModelRefR

destinationModelRef

);

eeh

// return a 106 element which will be used to save constraints model

destinationModelRef

// specify destinate

dgn model which the constraint element will reside instatic BentleyStatus SaveConstraints (EditElementHandleR eeh, T_Constraints& constraints);eeh // specify the element handle which will be used to save the constraints data, may be a new element created by Constraint3dElement::Create or an existing

constraint element.

constraints // a constraint vector which is to be saved.

Slide12

Constraint3dElement

an example wrapper function showing how to use it’s methods to merge and save constraint models.

Slide13

Constraint3dElement

the example wrapper function

SaveConstraintsToHost

in last slide can do constraint models merging if it is necessary, by deleting one constraint host element.

The left picture shows that there are two separate constraint models each involved in a pair of parallel constrained slabs. The right picture shows a merged constraint model after adding a perpendicular constraint between two slabs each of which is separately from a different constraint models in the left picture

Slide14

A complete example to create a perpendicular constraint between two solid faces, which shows how to use all the APIs introduced in previous slides.

Slide15

API headers

DgnDisplay

\PublicAPI\Constraint3d\Constraint3dCoreApi.h

MstnPlatform

\PublicAPI\Mstn\Constraint3dElement\Constraint3dElementApi.h