source: trunk/src/easymesh/easymesh-compiler.h @ 2350

Last change on this file since 2350 was 2226, checked in by touky, 7 years ago

Added CSG v0.001a : not optimized, too much operation makes it slow. triangle count is not optimized.
Useage : "...[.... csg*]" equals "current mesh -CSG- the mesh in the braces".
Keywords : CsgUnion<csgu>, CsgSubstract<csgs>, CsgAnd<csga>, CsgXor<csgx>
TODO : cleanup useless code.
TODO : Some bugs are still present, some face that disappear should not.
TODO : Correct epsilon useage (see geometry files).
TODO : Coplanar face are not handled -at all-.
TODO : Vertex count goes through the roof in case of a Xor.

File size: 1.5 KB
Line 
1//
2// Lol Engine
3//
4// Copyright: (c) 2010-2013 Sam Hocevar <sam@hocevar.net>
5//            (c) 2009-2013 Cédric Lecacheur <jordx@free.fr>
6//            (c) 2009-2013 Benjamin "Touky" Huet <huet.benjamin@gmail.com>
7//   This program is free software; you can redistribute it and/or
8//   modify it under the terms of the Do What The Fuck You Want To
9//   Public License, Version 2, as published by Sam Hocevar. See
10//   http://www.wtfpl.net/ for more details.
11//
12
13#ifndef __EASYMESH_COMPILER_H__
14#define __EASYMESH_COMPILER_H__
15
16#include <string>
17
18#ifndef __FLEX_LEXER_H
19#   define yyFlexLexer EasyMeshFlexLexer
20#   include "FlexLexer.h"
21#   undef yyFlexLexer
22#endif
23
24#include "generated/easymesh-parser.h"
25
26class EasyMesh;
27
28namespace lol
29{
30
31class EasyMeshScanner : public EasyMeshFlexLexer
32{
33public:
34    EasyMeshScanner(char const *command);
35    virtual ~EasyMeshScanner();
36    virtual int LexerInput(char* buf, int max_size);
37    virtual EasyMeshParser::token_type lex(EasyMeshParser::semantic_type* yylval,
38                                           EasyMeshParser::location_type* yylloc);
39
40private:
41    char const *m_input;
42};
43
44class EasyMeshCompiler
45{
46public:
47    EasyMeshCompiler(class EasyMesh &mesh);
48
49    bool ParseString(char const *command);
50
51    void Error(const class location& l, const std::string& m);
52    void Error(const std::string& m);
53
54    class EasyMeshScanner* m_lexer;
55    class EasyMesh &m_mesh;
56};
57
58} /* namespace lol */
59
60#endif /* __EASYMESH_COMPILER_H__ */
61
Note: See TracBrowser for help on using the repository browser.