IDFstepper
IDF to STEP converter
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Defines
Classes | Public Types | Public Member Functions | Static Public Attributes
stepper::StepGenerator Class Reference

The StepGenerator can produce 3D models in STEP format based on IDF descriptions. More...

#include <StepGenerator.hpp>

List of all members.

Classes

class  Silence

Public Types

enum  OverwritePolicy {
  ASK, NEVER, ALWAYS, YES,
  NO
}
 Controls the behaviour if an output file already exists. More...

Public Member Functions

 StepGenerator (std::ostringstream &eBuf)
 Default constructor for initialization.
void setComponentOverwritePolicy (OverwritePolicy policy)
 Sets the overwrite policy for components, i.e.
void setBoardOverwritePolicy (OverwritePolicy policy)
 Sets the overwrite policy for boards, i.e.
void setPanelOverwritePolicy (OverwritePolicy policy)
 Sets the overwrite policy for panels, i.e.
void setLibraryPath (const std::string &path)
 Sets the path to store the component library.
void setLibraryNamePattern (const std::string &pattern)
 Sets the file name pattern to use when handling file names for library components.
void setMinSolidHeight (double minHeight)
 Sets the minimum height of a solid.
void setBoardPath (const std::string &path)
 Sets the path to store the generated boards.
void setBoardNamePattern (const std::string &pattern)
 Sets the file name pattern to use when handling file names for boards.
void setPanelPath (const std::string &path)
 Sets the path to store the generated panels.
void setPanelNamePattern (const std::string &pattern)
 Sets the file name pattern to use when handling file names for panels.
void setMinHoleDiameter (double dia)
 Sets the minimum hole diameter which generates holes in a board/panel model.
bool setConfigOption (const std::string &key, const config::Value &value) throw (boost::bad_get)
 Uses the given key/value pair to set an internal config option.
void generateLibrary (const idf::LibraryStruct &lib) const
 Generates 3D models from a library structure.
void generateBoard (const idf::BoardPanelStruct &board) const
 Generates a 3D assembly from a board.
void generatePanel (const idf::BoardPanelStruct &panel) const
 Generates a 3D assembly from a panel.

Static Public Attributes

static const double EQUAL_PT_DIST = .001
 The maximum distance in mm to treat two vertices as equal.

Detailed Description

The StepGenerator can produce 3D models in STEP format based on IDF descriptions.

Basic operation involves generating Components (single solids) from idf::Component descriptions. If components are generated, boards can be created based on the board outline and a set of components, which then results in a STEP assembly. Multiple boards can finally be stored in a panel assembly.

Definition at line 38 of file StepGenerator.hpp.


Member Enumeration Documentation

Controls the behaviour if an output file already exists.

Enumerator:
ASK 

Ask user what to do.

If he/she selects "always" or "never", this will change the policy.

NEVER 

Never overwrite existing files.

ALWAYS 

Always overwrite existing files.

YES 

Replace single file.

NO 

Do not replace single file.

Definition at line 48 of file StepGenerator.hpp.


Constructor & Destructor Documentation

stepper::StepGenerator::StepGenerator ( std::ostringstream &  eBuf) [inline]

Default constructor for initialization.

This creates a StepGenerator with default settings. Use the setXY functions for configuration.

Parameters:
eBufStringstream to use as a buffer for error messages, all messages will then be placed into this buffer as well as being output to stderr.

Definition at line 71 of file StepGenerator.hpp.


Member Function Documentation

Generates a 3D assembly from a board.

Parameters:
boardBoard structure to use.

Definition at line 99 of file StepGenerator.cpp.

Generates 3D models from a library structure.

Parameters:
libLibrary structure to use.

Definition at line 82 of file StepGenerator.cpp.

Generates a 3D assembly from a panel.

Parameters:
panelBoard/Panel structure to use.

Definition at line 224 of file StepGenerator.cpp.

void stepper::StepGenerator::setBoardNamePattern ( const std::string &  pattern) [inline]

Sets the file name pattern to use when handling file names for boards.

The pattern may include the placeholder 'n' for the IDF "Board name" field. The same pattern is used when generating files from boards and when searching for files to be used in panels. Default is "%n.stp".

Parameters:
patternFile name pattern to use.

Definition at line 184 of file StepGenerator.hpp.

Sets the overwrite policy for boards, i.e.

what to do if a board file already exists. Default value is "ASK".

Parameters:
policyDesired behaviour, ASK, NEVER or ALWAYS.

Definition at line 98 of file StepGenerator.hpp.

void stepper::StepGenerator::setBoardPath ( const std::string &  path) [inline]

Sets the path to store the generated boards.

Default value is "", i.e. the current directory.

Parameters:
pathBoard path.

Definition at line 166 of file StepGenerator.hpp.

Sets the overwrite policy for components, i.e.

what to do if a component file already exists. Default value is "ASK".

Parameters:
policyDesired behaviour, ASK, NEVER or ALWAYS.

Definition at line 84 of file StepGenerator.hpp.

bool stepper::StepGenerator::setConfigOption ( const std::string &  key,
const config::Value value 
) throw (boost::bad_get)

Uses the given key/value pair to set an internal config option.

Parameters:
keyThe key string, see idfstepper.conf for details.
valueThe option's value, see idfstepper.conf for details.
Returns:
True if the key was recognized, false otherwise.
Exceptions:
boost::bad_getif the value is of the wrong type.

Definition at line 13 of file StepGenerator.cpp.

void stepper::StepGenerator::setLibraryNamePattern ( const std::string &  pattern) [inline]

Sets the file name pattern to use when handling file names for library components.

The pattern may include the placeholders 'n' for the IDF "Geometry name" field and 'p' for the "Part number" field. The same pattern is used when generating files from libraries and when searching for files to be used in boards. Default is "%n.stp".

Parameters:
patternFile name pattern to use.

Definition at line 144 of file StepGenerator.hpp.

void stepper::StepGenerator::setLibraryPath ( const std::string &  path) [inline]

Sets the path to store the component library.

Default value is "", i.e. the current directory.

Parameters:
pathLibrary path.

Definition at line 126 of file StepGenerator.hpp.

void stepper::StepGenerator::setMinHoleDiameter ( double  dia) [inline]

Sets the minimum hole diameter which generates holes in a board/panel model.

Pass 0.0 to drill all holes. Default value is 1mm.

Parameters:
diaMinimum diameter in mm.

Definition at line 221 of file StepGenerator.hpp.

void stepper::StepGenerator::setMinSolidHeight ( double  minHeight) [inline]

Sets the minimum height of a solid.

This avoids invalid solids if a component/board is specified with zero height/thickness, in which case the dimension is extended to this value. Default value is 0.1mm.

Parameters:
minHeightMinimum height in mm.

Definition at line 156 of file StepGenerator.hpp.

void stepper::StepGenerator::setPanelNamePattern ( const std::string &  pattern) [inline]

Sets the file name pattern to use when handling file names for panels.

The pattern may include the placeholder 'n' for the IDF "Board name" field. Default is "%n.stp".

Parameters:
patternFile name pattern to use.

Definition at line 210 of file StepGenerator.hpp.

Sets the overwrite policy for panels, i.e.

what to do if a panel file already exists. Default value is "ASK".

Parameters:
policyDesired behaviour, ASK, NEVER or ALWAYS.

Definition at line 112 of file StepGenerator.hpp.

void stepper::StepGenerator::setPanelPath ( const std::string &  path) [inline]

Sets the path to store the generated panels.

Default value is "", i.e. the current directory.

Parameters:
pathPanel path.

Definition at line 194 of file StepGenerator.hpp.


Member Data Documentation

const double stepper::StepGenerator::EQUAL_PT_DIST = .001 [static]

The maximum distance in mm to treat two vertices as equal.

Definition at line 43 of file StepGenerator.hpp.


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Defines