KJB
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | List of all members
kjb::TopoFusion::AutoLayer Class Reference

RAII approach to the old TopoFusion Layer data structure. More...

#include <autolayer.h>

Public Member Functions

 AutoLayer ()
 default ctor makes a Layer ready for writing More...
 
 AutoLayer (const std::string &filename)
 ctor loads a layer from a named file More...
 
ptset_track0points (unsigned, const pt *src=00)
 define the first track in a layer. More...
 
void add_waypoint (const pt &, const char *, int)
 A layer can hold a list of waypoints; this adds one to the list. More...
 
 operator const layer & () const
 this cheat lets us use an AutoLayer like a const Layer object More...
 
layerget_writable_ptr ()
 This is a "dangerous" method that lets you manipulate the Layer. More...
 
int write (const std::string &filename)
 Write a layer into a file. More...
 
 ~AutoLayer ()
 Dtor makes sure the layer resources are released. More...
 

Detailed Description

RAII approach to the old TopoFusion Layer data structure.

Constructor & Destructor Documentation

kjb::TopoFusion::AutoLayer::AutoLayer ( )
inline

default ctor makes a Layer ready for writing

kjb::TopoFusion::AutoLayer::AutoLayer ( const std::string &  filename)
inline

ctor loads a layer from a named file

kjb::TopoFusion::AutoLayer::~AutoLayer ( )
inline

Dtor makes sure the layer resources are released.

Member Function Documentation

void kjb::TopoFusion::AutoLayer::add_waypoint ( const pt p,
const char *  name,
int  index 
)

A layer can hold a list of waypoints; this adds one to the list.

We CANNOT use the add waypoint method of layer.h because that assumes the waypoint is to be inserted somewhere in the global Layer structure, which we no longer use. This method emulates that one; REALLOC makes it briefer.

layer* kjb::TopoFusion::AutoLayer::get_writable_ptr ( )
inline

This is a "dangerous" method that lets you manipulate the Layer.

kjb::TopoFusion::AutoLayer::operator const layer & ( ) const
inline

this cheat lets us use an AutoLayer like a const Layer object

pt * kjb::TopoFusion::AutoLayer::set_track0points ( unsigned  num,
const pt src = 00 
)

define the first track in a layer.

Parameters
numnumber of points in the track
srcarray of points (pt objects) in the track
Returns
pointer to array of points where the input is stored

A Layer can hold multiple tracks. This method lets you specify the points (an array of struct pt objects) for the first track.

int kjb::TopoFusion::AutoLayer::write ( const std::string &  filename)
inline

Write a layer into a file.


The documentation for this class was generated from the following files: