Creates meshes from OpenSCAD .csg files.
More...
#include <geogram/mesh/mesh_CSG_compiler.h>
|
std::shared_ptr< Mesh > | compile_file (const std::filesystem::path &input_filename) |
|
std::shared_ptr< Mesh > | compile_string (const std::string &source) |
|
void | set_verbose (bool x) |
| Displays (lots of) additional information.
|
|
void | set_detailed_verbose (bool x) |
| Displays (even more) additional information.
|
|
CSGBuilder & | builder () |
| Gets the CSGbuilder.
|
|
const CSGBuilder & | builder () const |
| Gets the CSGbuilder.
|
|
|
void | parse_instruction_or_object () |
|
void | parse_object () |
|
void | parse_instruction () |
|
ArgList | parse_arg_list () |
|
Value | parse_value () |
|
Value | parse_array () |
|
bool | is_object (const std::string &id) const |
|
bool | is_instruction (const std::string &id) const |
|
bool | is_modifier (int toktype) const |
| Checks if a token corresponds to an instruction or object modifier.
|
|
void | next_token_check (char c) |
| Checks that the next token is a given character.
|
|
Token | next_token () |
| Gets the next token.
|
|
Token | lookahead_token () |
| Gets the next token without any side effect.
|
|
Token | next_token_internal () |
| Function to actually get the next token from the stream.
|
|
int | lines () const |
| Gets the total number of lines of the currently parsed source.
|
|
int | line () const |
| Gets the currently parsed line source.
|
|
void | syntax_error (const char *msg) |
| Throws an exception with an error message.
|
|
void | syntax_error (const char *msg, const Token &tok) |
| Throws an exception with an error message.
|
|
void | compute_lines () const |
|
Creates meshes from OpenSCAD .csg files.
Understands a subset of OpenSCAD .csg format.
Definition at line 57 of file mesh_CSG_compiler.h.
◆ ArgList
◆ Value
◆ builder() [1/2]
◆ builder() [2/2]
const CSGBuilder & GEO::CSGCompiler::builder |
( |
| ) |
const |
|
inline |
◆ is_modifier()
bool GEO::CSGCompiler::is_modifier |
( |
int |
toktype | ) |
const |
|
protected |
Checks if a token corresponds to an instruction or object modifier.
A modifier is one of '','#','!','*', where '' and '*' discard the subtree, '#' does not change anything and '!' replaces the result with the subtree (re-root). Note: in OpenSCAD, '' and '#' display the subtree as a transparent object.
◆ lookahead_token()
Token GEO::CSGCompiler::lookahead_token |
( |
| ) |
|
|
protected |
Gets the next token without any side effect.
Parsing position remains at the same token.
◆ next_token()
Token GEO::CSGCompiler::next_token |
( |
| ) |
|
|
protected |
Gets the next token.
Parsing proceeds to the next token.
◆ next_token_check()
void GEO::CSGCompiler::next_token_check |
( |
char |
c | ) |
|
|
protected |
Checks that the next token is a given character.
If the next token is something else than the given character, then parsing stops with an error message.
- Parameters
-
◆ next_token_internal()
Token GEO::CSGCompiler::next_token_internal |
( |
| ) |
|
|
protected |
Function to actually get the next token from the stream.
next_token() and lookahead_token() use a 1-token buffer to pretend that one can look at a token in advance without consuming it.
◆ set_detailed_verbose()
void GEO::CSGCompiler::set_detailed_verbose |
( |
bool |
x | ) |
|
|
inline |
Displays (even more) additional information.
- Parameters
-
[in] | x | whether additional information should be displayed. Default is off |
Definition at line 84 of file mesh_CSG_compiler.h.
◆ set_verbose()
void GEO::CSGCompiler::set_verbose |
( |
bool |
x | ) |
|
|
inline |
Displays (lots of) additional information.
- Parameters
-
[in] | x | whether additional information should be displayed. Default is off |
Definition at line 75 of file mesh_CSG_compiler.h.
◆ syntax_error() [1/2]
void GEO::CSGCompiler::syntax_error |
( |
const char * |
msg | ) |
|
|
protected |
Throws an exception with an error message.
- Parameters
-
[in] | msg | the error message to be displayed |
◆ syntax_error() [2/2]
void GEO::CSGCompiler::syntax_error |
( |
const char * |
msg, |
|
|
const Token & |
tok |
|
) |
| |
|
protected |
Throws an exception with an error message.
- Parameters
-
[in] | msg | the error message to be displayed |
[in] | tok | the currently parsed token, will be appended to the error message |
The documentation for this class was generated from the following file: