|
Application Programming Interface
The API is composed of a set of modules which encapsulate access to the library. A module is a set of static functions regrouped under a unique C++ class. These modules are inherited.
This page has been extracted from the Developer's Guide.
Gobj
SYNOPSIS
#include <gocad/gapi//gobj_api.h>
INTERFACE
interface gobj {
}
- gobj::load
- static GObj* load(const CString& file);
- Load the first object of a file and returns this object. It returns nil if the file or object was invalid. The object is added to the list of objects in the geobase. This function is left has a convenience function as it assumes that there is only one object in the file. Other gobj::load functions should be used instead.
- gobj::load
- static bool load(const CString& file, PtrList<GObj>& gobjs) ;
- gobj::load
- static bool load(int fd, PtrList<GObj>& gobjs) ;
- Loads a file and returns the list of objects successfuly read read from the file. These objects will be added to the list of objects of the GeobaseLib. The file parameter can be the name of an existing file or can be a UNIX command which will output a GObj in ASCII format on its standard output. In the later case, the string must end with a '|' (pipe).
- gobj::load
- static bool load(const List<CopyCString>& files);
- Loads a list of ascii files. Each object contained in the files will stored in the list of objects of the GeobaseLib. Each file may contains a list of GObj. See parameter file description above.
- gobj::load
- static bool load(const PtrList<char>& files);
- Loads a list of ascii files. Each object contained in the files will stored in the list of objects of the GeobaseLib. Each file may contains a list of GObj.
- gobj::save
- static bool save(GObj* gobj);
- static bool save(GObj* gobj, const CString& filename);
- Saves in ascii format a gobj on either its default file or on a given file. The default file name is deduced from the object name and the object class name. A list of pre-defined file extension is defined for all the types of objects (in app-defaults/Gocad).
- gobj::save
- static bool save(const PtrList<GObj> &gobjs, int fd) ;
- Saves a list of Gobj on the file defined by its file descriptor. Each GObj will be written successively onto the file, separated with the END keyword.
- gobj::save_as
- static bool save_as(const PtrList<GObj>& gobjs, const CString& file);
- Saves a list of GObj on a given ascii file. Each GObj will be written successively onto the file, separated with the END keyword.
- gobj::destroy
- static void destroy(GObj* gobj);
- gobj::destroy
- static void destroy(const PtrList<GObj>& gobjs);
- gobj::destroy_all
- static void destroy_all();
- Delete the given gobj(s) or all the gobjs.
- gobj::copy
- static GObj* copy( const GObj &rhs, const CString& name, bool copy_style=true, bool copy_points=true,bool copy_properties=false, bool copy_regions=false, bool copy_constraints=false ) ;
- Copies the given rhs (right hand side) object into the new object of name "name" using the copy flags.
- gobj::name
- static const char* name(GObj* gobj) ;
- Returns the name of the given GObj.
- gobj::set_name
- static bool set_name(GObj *gobj, const CString& new_name);
- Changes the name of a given GObj.
- gobj::apply_script
- static void apply_script( GObj* gobj, const CString& script, const CString& region_name = nilstr );
- Given a script apply that script on a GObj. The script is given in a character string. Script syntax description can be found in the Developer's Guide.
- gobj::check_name
- static bool check_name(const CString &name) ;
- Check if a name of a GObj is valid. It must not be empty and it should not contain space (' ') or '.'.
|
Atomic
SYNOPSIS
#include <gocad/gapi//atomic_api.h>
INTERFACE
interface atomic : gobj {
}
DSI
- atomic::run_dsi_properties
- static bool run_dsi_properties( AtomicGroup* atomic, int nbiter=10, bool smooth=false, bool conjugate=false ) ;
- atomic::run_dsi_properties
- static bool run_dsi_properties( Atomic* atomic, int nbiter=10, bool smooth=false, bool conjugate=false );
- Runs DSI on all the properties of the given atomic. By default the number of iterations of DSI is set to nbiter=10 and DSI is run on non-smooth mode.
- atomic::run_dsi_geo
- static bool run_dsi_geo( Atomic* atomic, int nbiter=10, bool smooth=false, bool conj=false );
- atomic::run_dsi_geo
- static bool run_dsi_geo( AtomicGroup* atomic, int nbiter=10, bool smooth=false, bool conj=false );
- Runs DSI on the geometry of the the given atomic. By default the number of iterations of DSI is set to nbiter=10 and DSI is run on non-smooth mode.
- atomic::init_dsi_property
- static bool init_dsi_property(Atomic* atomic,const CString& property_name);
- atomic::init_dsi_property
- static bool init_dsi_property( AtomicGroup* atomic,const CString& property_name );
- atomic::init_dsi_property
- static bool init_dsi_property(Atomic* atomic,int property_record_index);
- atomic::init_dsi_property
- static bool init_dsi_property( AtomicGroup* atomic,int property_record_index );
- Initialize the given property onto all the Atoms of the atomic. The property can be either referenced by its name or by its index in the property data record of the atoms of the atomic. For that for each atoms where the value is set (by either a property constraint or a property control node) this value is propagated onto the neighbors recursively.
- atomic::run_dsi_property
- static bool run_dsi_property( Atomic* atomic, const CString& property_name, int nbiter=10, bool smooth=false, bool conjugate=false );
- atomic::run_dsi_property
- static bool run_dsi_property( AtomicGroup* atomic, const CString& property_name, int nbiter=10, bool smooth=false, bool conjugate=false );
- Runs DSI on only one property of name "property_name" of the given atomic. The default set of number of iterations is set to 10.
Properties operation
- atomic::get_property_record_index
- static int get_property_record_index( AtomicGroup *atomic, const CString &property_name ) ;
- Returns the index of the property inside the property record associated to the atoms of the atomic group.
- atomic::property_value
- static float property_value(Atom *a, int property_record_index) ;
- Returns the value of the property given the property record index.
- atomic::add_property
- static bool add_property(AtomicGroup* atomic,const CString& property_name);
- atomic::add_property
- static bool add_property( AtomicGroup* atomic, const CString& property_name, const CString& property_class, const NoDataValue &nodatavalue, const Range<float> &range, const CString& unit ) ;
- Adds to an atomic a property given its name and/or its property class, no data value, range of validity and unit. The no data value specifies the value to initialize the property to. When a property is added all the atoms data records of all the atomic of the atomicgroup will be changed.
- atomic::rename_property
- static bool rename_property( AtomicGroup* atomic_group, const CString& old_name, const CString& new_name );
- Changes the name of a property from old_name to new_name. This function has been superseeded by the function property::rename
- atomic::delete_property
- static bool delete_property(AtomicGroup* ag, const CString& property_name);
- atomic::delete_property
- static bool delete_property(Atomic*, const CString &property_name) ;
- atomic::delete_property
- static bool delete_property(AtomicGroup* ag, int property_index);
- Deletes a property by either giving its name or its index number in the property database. The property value will be deleted from every atoms of all the atomics belonging to the atomic group. When a property is deleted all the atoms data records of all the atomic of the atomicgroup will be changed.
- atomic::apply_script
- static bool apply_script( Atomic* atomic, const CString& script, const CString& region_name = nilstr );
- The script which code is contained in the input character string "script" is run on all the atoms of the atomic.
- atomic::apply_script
- static bool apply_script( AtomicGroup* group, const CString& script, const CString& region_name = nilstr );
- The script which code is contained in the input character string "script" is run on all the atomics of the AtomicGroup.
- atomic::apply_script_on_region
- static bool apply_script_on_region( AtomicGroup* atomic, const CString& script, const CString& region_name );
- atomic::apply_script_on_region
- static bool apply_script_on_region( AtomicGroup*, AtomicGroupRegion* region, const CString& script );
- The script which code is contained in the input character string "script" is run on all the atoms of the AtomicGroupRegion.
Operations on Regions
- atomic::destroy_region
- static bool destroy_region(AtomicGroup *atomic, const CString& region_name);
- Remove region.
- atomic::run_dsi_in_region
- static bool run_dsi_in_region( Atomic* atomic, const CString& region, int nbiter=10, bool smooth=false );
- atomic::run_dsi_in_region
- static bool run_dsi_in_region( Atomic* atomic, AtomicGroupRegion* region, int nbiter=10, bool smooth=false );
- Run DSI on all the atoms of a given AtomicGroupRegion.
- atomic::paint_region
- static bool paint_region( AtomicGroup* atomic, const CString& region_name, int nbrings, Atom* atom );
- atomic::paint_region
- static bool paint_region(AtomicGroupRegion* region, int nbrings, Atom* atom);
- Adds in the given AtomicGroupRegion all the atoms contained in the "nbrings" rings around the given atom. The AtomicGroupRegion can be specified using its name.
- atomic::erase_region
- static bool erase_region( AtomicGroup* atomic, const CString& region_name, int nbrings, Atom* atom );
- atomic::erase_region
- static bool erase_region(AtomicGroupRegion* region, int nbrings, Atom* atom);
- Removes from the given AtomicGroupRegion all the atoms contained in the "nbrings" rings around the given atom. The AtomicGroupRegion can be specified using its name.
- atomic::clear_region
- static bool clear_region(AtomicGroup* atomic, const CString& region_name);
- atomic::clear_region
- static bool clear_region(AtomicGroupRegion* region);
- Removes all the atoms from the given AtomicGroupRegion.
- atomic::reverse_region
- static bool reverse_region(AtomicGroup* atomic, const CString& region_name);
- atomic::reverse_region
- static bool reverse_region(AtomicGroupRegion* region);
- Adds all the atoms which were not in the region inside the region and removes all the atoms which were in the region.
- atomic::expand_region
- static bool expand_region( AtomicGroup* atomic, const CString& region_name, int nbrings );
- atomic::expand_region
- static bool expand_region(AtomicGroupRegion* region, int nbrings);
- Expands the given region by "nbrings" rings around its border. All the atoms inside these external "nbrings" rings around its border will be added inside the region.
- atomic::shrink_region
- static bool shrink_region( AtomicGroup* atomic, const CString& region_name, int nbrings );
- atomic::shrink_region
- static bool shrink_region(AtomicGroupRegion* region, int nbrings);
- Shrinks the given region by "nbrings" rings around its border. All the atoms inside these internal "nbrings" rings its border will be removed from the region.
Node operations
- atomic::set_control_node_everywhere
- static bool set_control_node_everywhere(AtomicGroup *atomic) ;
- atomic::set_control_node_everywhere
- static bool set_control_node_everywhere(Atomic *atomic) ;
- Set all atoms of the atomic to be control nodes.
- atomic::remove_all_control_nodes
- static bool remove_all_control_nodes(AtomicGroup* atomic);
- atomic::remove_all_control_nodes
- static bool remove_all_control_nodes(Atomic* atomic);
- Removes all the control node of the given atomic.
- atomic::unset_control_node
- static bool unset_control_node(PtrSet<Atom>& atoms);
- atomic::unset_control_node
- static bool unset_control_node(Atom* atom);
- Changes a control node to a normal atom.
- atomic::set_control_node
- static bool set_control_node(Atom* atom);
- atomic::set_control_node
- static bool set_control_node(PtrSet<Atom>& atoms);
- Changes the atom to a control node.
- atomic::set_control_node_property_everywhere
- static bool set_control_node_property_everywhere( AtomicGroup *atomic, const CString& property ) ;
- atomic::set_control_node_property_everywhere
- static bool set_control_node_property_everywhere( Atomic *atomic, const CString& property ) ;
- atomic::set_control_node_property_everywhere
- static bool set_control_node_property_everywhere( Atomic *atomic, int property_index ) ;
- Set all atoms of the atomic to be control nodes property for the given property.
- atomic::remove_all_control_nodes_property
- static bool remove_all_control_nodes_property( AtomicGroup* ag, const CString& property );
- atomic::remove_all_control_nodes_property
- static bool remove_all_control_nodes_property( AtomicGroup* ag, int property_index );
- atomic::remove_all_control_nodes_property
- static bool remove_all_control_nodes_property( Atomic* atomic, const CString& property );
- atomic::remove_all_control_nodes_property
- static bool remove_all_control_nodes_property( Atomic* atomic, int property_index );
- Removes all the control node of the given atomic property.
- atomic::unset_control_node_property
- static bool unset_control_node_property( Atomic* atomic, Atom* atom, const CString& property ) ;
- atomic::unset_control_node_property
- static bool unset_control_node_property( Atomic* atomic, PtrSet<Atom>& atoms, const CString& property );
- Changes a control node to a normal atom property.
- atomic::set_control_node_property
- static bool set_control_node_property( Atomic* atomic, Atom*atom, const CString& property ) ;
- atomic::set_control_node_property
- static bool set_control_node_property( Atomic* atomic, PtrSet<Atom>& atoms, const CString& property );
- Changes the atom to a control node property.
Move point
- atomic::move_atomic
- static bool move_with_vector(Atomic*, const Vector3d& v);
- atomic::move_to_point
- static bool move_to_point(Atomic*atomic, Atom* atom, const Point3d& p);
- Moves the atom location to the given point.
- atomic::move_with_vector
- static bool move_with_vector( Atomic*atomic, Atom* atom, const Vector3d& vector );
- Translate the atom location with the given vector.
- atomic::map_points_on_points
- static bool map_points_on_points( PtrList<AtomicGroup>& atgps, PtrList<AtomicGroup>& targets, float dmax );
- For each point of atgps, search for the nearest target point and affect the Z of this target point to the atgp point. The distance is measured in 2D (x,y). The distance between atgp point and the target point needs to be less than the given dmax distance.
- atomic::edit_property
- static bool edit_property( AtomicGroup* atomic_group, Atom* atom, const CString& property_name, const CString& values, bool cpn );
- Edit the property defined inside one atom. The string value can store several numbers if the property is a vector. The atom may become a control node property is cnp is set to true.
- atomic::edit_property
- static bool edit_property( AtomicGroup* atomic_group, Atom* atom, const CString& property_name, float* value, int n, bool cnp ) ;
- Edit the property defined inside one atom with the given array of value. The atom may become a control node property is cnp is set to true.
Link
- atomic::add_link
- static bool add_link( Atom* atom1, Atomic* atomic1, AtomicGroup* atomic_group_of_atom1, Atom* atom2, Atomic* atomic2, AtomicGroup* atomic_group_of_atom2 );
- atomic::remove_link
- static bool delete_link(AtomLink* atom_link);
Misc.
- atomic::dissociate
- static bool dissociate(AtomicGroup* atomicgroup);
- An object can share nodes with others. After have apply this function, the object doesn't share any node.
- atomic::compute_box
- static Box3d compute_box(PtrList<GObj> &gobjs) ;
- Compute the bounding box (parallel to the x,y,z axis) of a list of GObj.
- atomic::compute_cage
- static Cage3d compute_cage( PtrList<Atomic> &atomics, bool horizontal,float factors[3] ) ;
- atomic::compute_cage
- static Cage3d compute_cage( PtrList<AtomicGroup> &atomics, bool horizontal,float factors[3] ) ;
- atomic::compute_cage
- static Cage3d compute_cage( PtrList<GObj> &atomics, bool horizontal,float factors[3] ) ;
- Compute the cage (non parallel to the x,y,z axis) of a given list of atomics. For that we compute the principal components of all the points of the atomics. If the flag horizontal is set to true the cage will be horizontalized i.e. the third principal axis will be projected on a vertical. Three factors are given to expand or shrink the cage associated to the true principal components.
- atomic::transform_to_fit_points
- static bool transform_to_fit_atom_links(Atomic* atomic, bool translation_x, bool translation_y, bool translation_z, bool rotation_x, bool rotation_y, bool rotation_z );
- Computes and apply a transformation matrix. The transformation matrix is computed by the set of Atom-to-Atom links set between a master atomic and a slave atomic. The slave atomic is given in argument and will be transformed so that the total length of the Atom-to-Atom links decrease in size. The tranformation is constrained by the input boolean.
- atomic::set_geological_info
- static bool set_geological_info( GeoBoundary *bondary, const CString &geologic_feature, const CString& geological_type, const CString& stratigraphic_age, float stratigraphic_time ) ;
- Sets geological information on a surface, its geological type stratigraphic age and time.
|
Vset
SYNOPSIS
#include <gocad/gapi//atomic_api.h>
INTERFACE
interface atomic : gobj {
}
- vset::load
- static VSet* load(const CString& file);
- Load a file and returns the first object of the file, if the first object was a VSet. Otherwise return nil.
creation
- vset::create
- static VSet* create(const CString& name);
- Create an empty VSet and register it in the geobaselib. If a VSet of the same name exists, the existing VSet is returned.
- vset::create_from_points
- static VSet* create_from_points( const CString& name, const List<Point3d>& points );
- Creates a new VSet with the given list of points.
- vset::create_from_atomic_group
- static VSet* create_from_atomic_group( const CString& name, AtomicGroup* atomic_group, bool copy_properties=false, const CString& region_name=nilstr );
- Create a new VSet by copying Atoms from the AtomicGroup. One SubVSet will be created for each Atomic in the AtomicGroup. Properties are not copied by default.
- vset::create_from_well_markers
- static VSet* create_from_well_markers( const CString& name, const CString& marker_name, bool store_normal, const CString& property ) ;
- Create a VSet from a set of points given by a set of markers along well paths. If store_normal is true, get the normal for each marker.
- vset::create_from_well_markers_and_thickness
- static VSet* create_from_well_markers_and_store_thickness( const CString& name, const PtrList<Well>& wells, const CString& top_marker, const CString& bottom_marker, int ttype );
- Create a vset with a thickness property computed from the well markers
- vset::create_from_vsets
- static VSet* create_from_vsets( const CString& name, const PtrList<VSet> &vsets );
- Creates a VSet from a list of VSets. One SubVSet will be created for each of the input VSets. Properties are not copied
- vset::create_from_subvset
- static VSet* create_from_subvset( const CString& name, SubVSet* subvset );
- Create a VSet from a SubVSet of another VSet.
- vset::create_from_voxet_plane
- static VSet* create_from_voxet_plane( const CString& name, Voxet* voxet, int axis, int index, bool all_properties, const CString& prop_name );
- Will create a VSet from the plane of a voxet, storing either one property or all the properties.
- vset::create_from_vset_region
- static VSet* create_from_vset_region( const CString& name, VSet* pointset, const CString& region_name );
- Create a VSet from a region of another VSet.
- vset::create_from_points
- static VSet* create_from_points( const CString &name, const PtrList<Atom> &atoms );
- Create a VSet from a set of atoms.
- vset::create_atom
- static Atom* create_atom( const Point3d &p, int nprop=0, float *prop_value=nil ) ;
- Create an Atom from a position and optionally an array of properties. If an array of properties value is given, the properties must have been created before using property::create_property.
- vset::delete_atom, delete_atoms
- static bool delete_atom(SubVSet* vset, Atom* atom);
- vset::delete_atoms
- static bool delete_atoms(SubVSet* vset, const PtrSet<Atom>& atoms);
- Delete the atom(s) from the SubVSet.
- vset::delete_atoms_inout_grid
- static bool delete_atoms_inout_grid( SubVSet* svset, GridObj* grid, bool inside );
- Delete the atoms which are inside the GridObj if inside is true, or outside the object is inside is false.
- vset::delete_subvset
- static bool delete_subvset(SubVSet* svset);
- Delete the subvset from the VSet.
- vset::clip_subvset
- static bool clip_subvset(SubVSet* svset);
- Delete all the SubVset in a VSet except svset
- vset::partition
- static bool partition(SubVSet* subvset, int npartitions, int criterion);
- Takes the given SubVSet and partition it into npartitions clouds. The used criterion can be:
- - the number of points of the different parts ("Number of points")
- - the length of the third axis of the principal components ("Third axis of Principal Components")
- vset::filter
- static bool filter(SubVSet* subvset, int max_points, int criterion);
- Takes the given SubVSet and create a new subvset where the output number of points is max_points. The data are sorted by cluster and the nearest point to the cluster is taken as an output point The clustering criterion is the same as the one used for the partition function
- vset::segregate
- static bool segregate( SubVSet* subvset, const PtrList<TSurf>* tsurfs, float max_dist );
- Creates two new SubVSet per surface gathering all the points of the input SubVSet which are closest to the surface than the distance max_dist. One set is on one side of the surface the other set on the other side.
- vset::merge_subvsets
- static bool merge_subvsets(VSet* vset);
- Merges all the given subvsets of the given vset in a new subvset.
|
Pline
SYNOPSIS
#include <gocad/gapi//pline_api.h>
INTERFACE
- interface pline : atomic {
- }
INTERFACE
- interface plineframe : gobj {
- }
- pline::load
- static PLine* load(const CString& file) ;
- Load a file and returns the first object of the file, if the first object was a PLine. Otherwise return nil.
pline creation
- pline::create
- static PLine* create(const CString& name);
- Creates a pline of the given name if the pline does not exist in the database. Otherwise returns the pline in the database of that name.
- pline::create_from_vset_hull_with_normal
- static PLine* create_from_vset_hull( const CString& name, SubVSet* vset, const Vector3d* normal = nil, float scale=1.0 );
- Creates a pline from the convex hull of a vset projected in the plane defined by the normal. The pline can be scaled from its barycenter in this plane.
- pline::create_from_gshape_sections
- static PLine* create_from_gshape_sections( const CString& name, GShape* gshape );
- Create a PLine composed of all the sections of a gshape transformed into closed ILines.
- pline::create_from_gshape_backbones
- static PLine* create_from_gshape_backbones( const CString& name, GShapeBundle* gshape, bool copy_points=true );
- Create a PLine from the backbones of all the GShape inside the given GShapeBundle. If copy_points is true then the points of the given GShapeBunble are copied, otherwise they are shared with the created PLine.
- pline::create_from_tsurf_border
- static PLine* create_from_tsurf_border( const CString& name, const TFaceBorder *border ) ;
- Create a PLine from the border of a TFace. The points of the given TFaceBorder are shared with the created PLine. They can be dissociated with atomic::dissociate (See atomic_api.h).
- pline::create_from_tsurf_borders
- static PLine* create_from_tsurf_borders( const CString& name, const TSurf* tsurf ) ;
- Create a Pline from all the border of a Tsurf. It returns nil if there is no border. The border points of the given TSurf are shared with the created PLine. They can be dissociated with atomic::dissociate (See atomic_api.h).
- pline::create_from_tsurf_intersection
- static PLine* create_from_tsurf_intersection( const CString& name, const PtrList<TSurf> &surfaces ) ;
- Creates a PLine from the intersection line of the list of surfaces.
- pline::create_from_points
- static PLine* create_from_points( const CString& name, const List<Point3d> *points, bool closed ) ;
- Create a PLine from a list of Point3d.
- pline::create_from_plines
- static PLine* create_from_plines( const CString& name, const PtrList<PLine> &plines, bool copy_points=true ) ;
- Create a PLine from a copy of a list of plines. If copy_points is true then the points of the given TSurf(s) are copied, otherwise they are shared with the created PLine.
- pline::create_from_ilines
- static PLine* create_from_ilines( const CString& name, const PtrList<ILine> &ilines, bool copy_points=true ) ;
- Create a PLine from a copy of a list of ilines. If copy_points is true then the points of the given TSurf(s) are copied, otherwise they are shared with the created PLine.
- pline::create_between_plines
- static PLine* create_between_plines( const CString& name, int nb_points, const PtrList<PLine> &plines ) ;
- Create a series of lines between pairs of lines. For each pair of lines a middle line is created. If the number of points (nb_points) is equal to 0, the number of points of the created line will be equal to the largest number of points of each pair. Each plines should contain at best two ilines, but more complex configurations are accepted. For instance, if 3 plines contains 2,3 and 1 iline The building will use the following pairs (pl1.il1,pl1.il2), (pl1.il3,pl2.il1), (pl2.il2,pl3,il1).
- pline::create_from_plineframe_region
- static PLine* create_from_plineframe_region( const CString& name, BFrameRegion *bfr ) ;
- Creates a closed curve from a PLineFrame region. The points of the given BFrameRegion are shared with the created PLine. They can be dissociated with atomic::dissociate (See atomic_api.h).
- pline::add_well_curve
- static bool add_well_curve( PLine* pline, const Well* well, const CString& curve_name, const CString& top_marker_name, const CString& bottom_marker_name, int inc, bool even_sampling, float dz, bool show_errors ) ;
- Add a well curve to a pline. The line added will be sampled between two markers. Each point of the line will contain the property of the wellcurve defined by (curve_name). if (even_sampling) is false (inc) defines the sampling increment of the wellcurve. If (even_sampling) is true, the pline will be sampled every (dz).
- pline::create_from_well_curve
- static PLine* create_from_well_curve( const CString& name, const Well* well, const CString& curve_name, const CString& top_marker_name, const CString& bottom_marker_name, int inc, bool even_sampling, float dz ) ;
- Create a PLine from a wellpath between two markers (top_marker_name) and (bottom_marker_name). Each point of the pline will contain the property of the wellcurve defined by (curve_name). (inc) defines the sampling increment of the wellcurve if (even_sampling) is false. If (even_sampling) is true, the pline will be sampled every (dz).
- pline::create_from_well_curve_group
- static PLine* create_from_well_curve_group( const CString& name, const HeterogeneousGroup* group, const CString& curve_name, const CString& top_marker_name, const CString& bottom_marker_name, int inc, bool even_sampling, float dz ) ;
- Create a PLine from a Well Curve Group and between marker picks. Each point of the lines will contain the property of the wellcurve defined by (curve_name). if (even_sampling) is false (inc) defines the sampling increment of the wellcurve. If (even_sampling) is true, the pline will be sampled every (dz).
- pline::create_from_well_path
- static PLine* create_from_well_path(const CString& name,const Well*) ;
- Create a PLine a the path of a well Measured depths will be stored as a property called "zm"
- pline::create_from_well_path_group
- static PLine* create_from_well_path_group( const CString& name, const HeterogeneousGroup* group ) ;
- Create a PLine from the paths of group of wells. Measured depths will be stored as a property called "zm"
- pline::create_from_well
- static PLine* create_from_well( const CString& name, GObj* well_or_wellgroup, float dz, const CString& top_marker_name, const CString& bottom_marker_name ) ;
- Creates a PLine from a Well or a WellGroup. Each WellCurve in each Well will be added to the PLine as a property.
- pline::create_from_tsurf_contours
- static PLine* create_from_tsurf_contours( const CString &name, TSurf *tsurf, const CString& iso_name, bool save_property=false ) ;
- Creates a PLine from a set of contours.
- pline::create_from_sliced_3d_vset
- static PLine* create_from_sliced_3d_vset( const CString& name, VSet* vset, Voxet *voxet, int plane, int tol, int jump ) ;
- Creates a pline which will be composed of many ilines. Each ILine represents a slice of the VSet along one of the plane of the Voxet.
- pline::create_from_segments
- static PLine* create_from_segments( const CString &name, const PtrList<SegUse>& segs ) ;
- Creates a PLine from a set of Segments. The algorithm will find all the segments which are connected to each others and will create an ILine for each group of connected segments.
- pline::create_segment
- static SegUse* create_segment(Atom* a0, Atom *a1) ;
- Creates a segment from two atoms.
- pline::create_atom
- static Atom* create_atom(const Point3d &) ;
- Creates a segment from two atoms.
Query
- pline::get_atoms
- static PLineAtomsItr get_atoms(PLine *pline);
- Returns an iterator on all the atoms of a PLine.
- pline::nb_parts
- static int nb_parts(PLine *pline);
- Returns the number of ILines of the pline. A ILine contains a set of connected seg. A PLine may contain many ILines.
- pline::part
- static ILine* part(PLine *pline, int index);
- Returns the ILine at the given index inside the PLine.
- pline::is_closed
- static bool is_closed(ILine *iline);
- Returns true if the ILine is closed.
Pline editing
- pline::filter_size
- static bool filter_size(PLine* pline, float minimum_size);
- Remove all the segments which size is inferieur to the given minimum size.
- pline::filter_angle
- static bool filter_angle(PLine* pline, float minimum_angle);
- Remove all the segments which do no make an angle with the next segment greater than the given minimum angle.
- pline::filter_segments
- static bool filter_segments(PLine* pline);
- Remove all the segments which are at the same location.
- pline::densify
- static bool densify(PLine* pline, float minimum_length);
- Densify all the segment of length greater than minimum_length so that every segments in this segment are no smaller than the minimum_length.
- pline::split
- static bool split(PLine* pline);
- Densify all the segment of the curve by adding atoms in the middle of the segments
- pline::optimize_with_vset
- static bool optimize_with_vset( ILine *iline, SegUse *seguse, VSet *vsetg, float altitude ) ;
- pline::optimize_with_vset
- static bool optimize_with_vset(ILine *iline, VSet *vsetg, float altitude);
- Densify all the segments or one segment using the points of the vset. New points are added to the line to better fit the VSet. Points are added when in a segment the "closest" point of the VSet to this segment is nearer than h*half the length of the segment.
- pline::kill_iline
- static bool kill_iline(ILine *iline) ;
- Removes a complete isolated line (connected segments) from its parent pline.
- pline::kill_ilines
- static bool kill_ilines(const PtrSet<ILine>& ilines);
- Removes a set of complete isolated line (ILine). All the given ILine(s) should belong to the same PLine. Otherwise nothing is done.
- pline::clip_iline
- static bool clip_iline(ILine* iline);
- Keep this Iline and destroy all the other ilines in the same PLine.
- pline::clip_ilines
- static bool clip_ilines(const PtrSet<ILine>& ilines);
- Just keep the ILine(s) which are in the given set of ILine(s). All the given ILine(s) should belong to the same PLine. Otherwise nothing is done.
- pline::merge_ilines
- static bool merge_ilines(PLine *pline, bool exactly=true);
- pline::merge_ilines
- static bool merge_ilines(const PtrSet<ILine>& in, bool exactly=true);
- Merge the different ILines of a PLine or of a set of ILines in one ILine (if possible). This is applicable after multi pline_create where the same name was given multiple times.
- pline::split_ilines_from_corners
- static bool split_ilines_from_corners(PLine *pline) ;
- Split the different ILines of a PLine when there is an important change in direction.
- pline::link_extremities
- static bool link_extremities(PLine* pline);
- Set automaticlly the Atom Links between the ILines extremites
- pline::merge_from_links
- static bool merge_from_links(PLine* pline);
- Reconstruct the PLine with taking into account the Atom Links between ILines extremites. This links are transformed into segments and Pline is reinitialized. The links and old ILines are deleted.
- pline::kill_simplex
- static bool kill_simplex(ILine* iline, SegUse* seguse);
- Remove the given segment living a hole inside the iline. The iline will be deleted and two ilines will be created.
- pline::collapse_simplex
- static bool collapse_simplex(ILine* iline, SegUse* seguse);
- Remove the given segment and join the two adjacent segments (if they exist).
- pline::kill_atom
- static bool kill_atom(ILine* iline, Atom* atom);
- Remove the atom (and the one or two segments attached to it) from the iline living a hole inside the iline. The iline may be deleted.
- pline::disconnect_atom
- static bool disconnect_atom(ILine* iline, Atom* atom);
- Create a new Atom at the same location but not connected to it. This will create two new extremities.
- pline::collapse_atom
- static bool collapse_atom(ILine* iline, Atom* atom);
- Remove the given atom and join the adjacent segments (if they exist).
- pline::break_simplex
- static bool break_simplex( ILine* iline, SegUse* seguse, const Point3d& p );
- Adds a point on a segment.
- pline::sew_ilines
- static bool bridge_atoms( PLine* pline, Atom* a1, Atom* a2 );
- Connect two ends atom of two (eventually) different Ilines two create (or closed) one iline.
- pline::extend_atom
- static bool extend_atom(ILine* iline, Atom* atom);
- Adds a segment at the end of an open ILine. The segment will be equal in length to the old ending segment.
- pline::find_simplex, find_atom
- static bool find_simplex(ILine *iline, SegUse *seguse) ;
- pline::find_atom
- static bool find_atom(ILine *iline, Atom *atom) ;
- Returns true if the segment of atom really belongs to the iline.
pline Constraint commands
- pline::set_fuzzy_control_points
- static PLineFCPCnstrLink* set_fuzzy_control_points( PLine* curve, AtomicGroup* atg, bool auto_activation, double maximum_activation_distance );
- Set Fuzzy Control Points between a VSet and a PLine The activation of the constraints can be configured so that points which are further a given distance will not attract the pline.
- pline::set_cth
- static SADCnstrLink* set_cth( PLine* pline, TSurf* target, bool constant_thickness, float thickness, const CString& property_name, const Vector3d &dir );
- Set the pline to be at a certain distance from the given tsurf. The thickness can be constant or can be read on the surface using the property property_name.
- pline::fit_cth
- static bool fit_cth( PLine* pline, TSurf* target, const Vector3d& dir, bool constant_thickness, float constant_thickness_value, const CString& property_name );
- Move the pline to be at a certain distance from the given tsurf. The thickness can be constant or can be read on the surface using the property property_name.
- pline::compute_length
- static double compute_length(ILine *iline) ;
- returns the length of the line.
- pline::compute_curvature
- static void compute_curvature( PLine* curve );
- Computes the curvature properties of the curve.
- pline::compute_torsion
- static void compute_torsion( PLine* curve );
- Computes the torsion property of the curve.
- plineframe::create_from_plines
- static PLineFrame* create_from_plines( const CString& name, float tolerance, const PtrList<PLine> &plines ) ;
- Create a PLineFrame given a name and a list of plines.
- plineframe::build
- static bool build(PLineFrame *plf) ;
- Build the regions of the plineframe.
- plineframe::build_close
- static bool build_close(PLineFrame *plf) ;
- plineframe::build_close
- static bool build_close(PLineFrame *plf,const PtrList<PLine> &plines) ;
- plineframe::build_close_with_cvxhull
- static bool build_close_with_cvxhull( PLineFrame *plf,bool optimize=false,Coord h=1 ) ;
- Close an open plineframe. If no ordered list of plines is given only the ends of the plineframe are closed. If a list of plines is given two plines will be constructed which join in order the ending points of each pline. The plineframe can be also closed using an optimized convex-hull.
- plineframe::densify_plines
- static bool densify_plines(PLineFrame *plf) ;
- Densify all the segments of a all the plines of the plineframe to the average segment size of all the segments of all the plines.
- plineframe::set_tolerance
- static bool set_tolerance(PLineFrame *plf, float tol) ;
- Sets the tolerance of the PLineFrame.
- plineframe::connect_plines
- static bool connect_plines( PLineFrame *plf, PLine *pline1, PLine *pline2 ) ;
- Compute the intersections between the two PLines and rebuild the PLineFrame ;
- plineframe::remove_pline
- static bool remove_pline(PLineFrame *plf, PLine *pl) ;
- Removes the given pline from the PlineFrame. The PLineFrame is rebuild.
- plineframe::add_pline
- static bool add_pline(PLineFrame *plf, PLine *pl) ;
- Adds the given pline to the PlineFrame. The PLineFrame is rebuild.
|
TSurf
SYNOPSIS
#include <gocad/gapi//tsurf_api.h>
INTERFACE
- interface tsurf : atomic {
- }
INTERFACE
- interface tsurf_cnstr {
- }
- tsurf::load
- static TSurf* load(const CString& file);
- Load a file and returns the first object of the file, if the first object was a TSurf. Otherwise return nil. The object is added to the list of objects in the geobase. This function is left has a convenience function as it assumes that there is only one object in the file.
Creation
- tsurf::create_from_skin
- static TSurf* create_from_skin( const CString& name, ILine* top, ILine* bottom,int nblevels=1 );
- Create a surface by joining the top and bottom Ilines (closed or open) atoms. If the name of a already existing TSurf is given the TFace created from the skin will be appended to the list of TFaces of the tsurf. The points of the given ILine(s) are shared with the created TSurf. They can be dissociated with atomic::dissociate (See atomic_api.h).
- tsurf::create_from_several_skin
- static TSurf* create_from_several_skin( const CString& name, const PtrList<ILine>& ilines );
- Create a surface between several curves. They all should be either closed or open The points of the given ILine(s) are shared with the created TSurf. They can be dissociated with atomic::dissociate (See atomic_api.h).
- tsurf::create_from_patch
- static TSurf* create_from_patch( const CString& name, ILine* curve, Patcher::DensificationType densification_type, float densify_factor = 1.0, Vector3d* normal = nil );
- Create a surface by filling the hole of a closed curve. If the name of a already existing TSurf is given the TFace created from the patch will be appended to the list of TFaces of the tsurf. One can choose a factor in range [0.1..1.0] for generation of triangles inside curve. Algorithm stops when average edge length of triangle is equal to average length of curve segments / densify_factor. One can choose between strategy for inserting triangle points inside curve. With densification_type set to "no densification" (i.e 0), no points are added. With densification_type set to "homogeneous triangles" (i.e. 1), algorithm stops when average edge length of triangle is equal to densify_factor * average length of curve segments. With densification_type set to "few triangles" (i.e. 2), algorithm stops when each triangle is "roughly" the same size as its neighbors densify_factor controls the roughness. If 'normal' is used, curve points are projected in a "principal" plane, based on this normal. The points of the given ILine are shared with the created TSurf. They can be dissociated with atomic::dissociate (See atomic_api.h).
- tsurf::create_from_points_and_curve
- static TSurf* create_from_points_and_curve( const CString& name, PLine* curve, AtomicGroup* points, bool use_normal, Vector3d normal );
- Create a surface by filling the hole of a closed curve. If the name of a already existing TSurf is given the TFace created from the patch will be appended to the list of TFaces of the tsurf. The points of atomicGroup inside the curve will be inserted. The ones outside will be ignored. The points of the given ILine and AtomicGroup are shared with the created TSurf. They can be dissociated with atomic::dissociate (See atomic_api.h).
- tsurf::create_from_border_and_faults_polygon
- static TSurf* create_from_border_and_faults_polygon( const CString& name, PLine* border, PLine* faults, AtomicGroup* points=nil );
- Create a surface by patching the inside of the border and leaving holes by the fault polygons.
- tsurf::create_from_pants
- static TSurf* create_from_pants( const CString& name, const PtrList<ILine>& top_curves, const PtrList<ILine>& bottom_curves );
- Create a surface by joining top and bottom curves. If the name of a already existing TSurf is given the TFace created from the patch will be appended to the list of TFaces of the tsurf. The points of the given ILine(s) are shared with the created TSurf. They can be dissociated with atomic::dissociate (See atomic_api.h).
- tsurf::create_from_atomic_group
- static TSurf * create_from_atomic_group( const CString& name, AtomicGroup* atomic_group, bool use_normal, Vector3d normal );
- Create a new surface with the same number of TFace as the number of Atomics inside the AtomicGroup. Each TFace is created from the 2D convex hull of each Atomic and by inserting all the points of the Atomic inside the triangulation. You can use the normal to project the AtomicGroup The points of the given AtomicGroup are shared with the created TSurf. They can be dissociated with atomic::dissociate (See atomic_api.h).
- tsurf::create_from_volume_skin
- static TSurf* create_from_solid_border( const CString& name, TVolume* volume );
- Create a surface from the border of a TVolume. The points of the given TVolume are shared with the created TSurf. They can be dissociated with atomic::dissociate (See atomic_api.h).
- tsurf::create_from_solid_borders
- static TSurf* create_from_solid_borders( const CString& name, TSolid* solid );
- Create a surface from all the borders of a TSolid. The points of the given TSolid are shared with the created TSurf. They can be dissociated with atomic::dissociate (See atomic_api.h).
- tsurf::create_from_gshape
- static TSurf* create_from_gshape( const CString& name, GShapeBundle* gsbundle, bool opened );
- Create a surface from the skin of a GShape. We can either create a closed surface or a opened surface if we do not join the last sections to their backbone points.
- tsurf::create_from_gridded_plane
- static TSurf* create_from_gridded_plane( const CString& name, const Point3d& p0, const Vector3d& u, const Vector3d& v, int nu, int nv );
- Create a surface given a grid definition.
- tsurf::create_from_sphere
- static TSurf* create_from_sphere( const CString& name, VSet* vset, int niter );
- Create a ellipsoid which best fit the set of points given by the VSet. The parameter niter
| |