JunkBox_Lib++ (for Windows) 1.10.1
Loading...
Searching...
No Matches
OBJDataTool.h
Go to the documentation of this file.
1#ifndef __JBXL_CPP_OBJ_TOOL_H_
2#define __JBXL_CPP_OBJ_TOOL_H_
3
9#include "tools++.h"
10#include "txml.h"
11
12#include "TriBrep.h"
13#include "Rotation.h"
14#include "ContourBaseData.h"
15#include "MaterialParam.h"
16#include "MeshObjectData.h"
17
18
19namespace jbxl {
20
21
22#define OBJDATATOOL_STR_OBJFL "OBJ File"
23#define OBJDATATOOL_STR_MTLFL "MTL File"
24#define OBJDATATOOL_STR_TOOL "Created by CBJDataTool in the JunkBox_Lib++ (https://github.com/JunkBox-Library)"
25#define OBJDATATOOL_STR_AUTHOR "JBXL OBJ Data Tool Library (C) 2024 by Fumi.Iseki"
26#define OBJDATATOOL_STR_VER "version 1.0.0, 1 Feb. 2024"
27
28#define OBJDATATOOL_MAX_FACET 500
29
30class OBJData;
31class OBJFacetGeoNode;
32class OBJFacetMtlNode;
33
34
36//
37
45{
46public:
47 OBJData(int n=0) { this->init(n);} // n: OBJデータ(SHELLデータ)の総数.デフォルト(n=0)ではアンカーを作る
48 virtual ~OBJData(void) { this->free();}
49
50public:
52 int num_obj; // nextに続くOBJ(SHELL)データの総数.
53
56 int engine;
57
59 bool forUE;
60
62
66
67public:
68 void init(int n);
69 void free(void);
70 void delete_next(void);
71
72 void setUnity(bool b) { this->forUnity = b;}
73 void setUE(bool b) { this->forUE = b;}
74 void setEngine(int);
75
77 void delAffineTrans (void) { freeAffineTrans(this->affineTrans);}
78
80
81public:
82 void addShell(MeshObjectData* shelldata, bool collider);
83 void closeSolid(void) {}
84
85 //void outputFile(const char* fn, const char* out_path, const char* ptm_dirn, const char* tex_dirn, const char* mtl_dirn);
86 //void output_mtl(char* fn, char* out_dirn, char* ptm_dirn, char* tex_dirn, char* bin_dirn);
87 //void output_obj(char* fn, char* out_dirn, char* ptm_dirn, char* tex_dirn, char* bin_dirn);
88 void outputFile(const char* fn, const char* out_path, const char* tex_dirn, const char* mtl_dirn);
89 void output_mtl(char* fn, char* out_dirn, char* tex_dirn, char* bin_dirn);
90 void output_obj(char* fn, char* out_dirn, char* tex_dirn, char* bin_dirn);
91 //void output_mtl(const char* mtl_path, const char* tex_dirn);
92 //void output_obj(const char* obj_path, const char* mtl_path);
93};
94
95
96inline void freeOBJData(OBJData* obj) { if(obj!=NULL) { obj->free(); delete obj; obj=NULL;} }
97
98
99
101//
103{
104public:
105 OBJFacetGeoNode() { this->init();}
106 virtual ~OBJFacetGeoNode(void) { this->free();}
107
108public:
113
118
120
122
123public:
124 void init(void);
125 void free(void);
126 void delete_next(void);
127};
128
129
131//
133{
134public:
135 OBJFacetMtlNode() { this->init();}
136 virtual ~OBJFacetMtlNode(void) { this->free();}
137
138public:
142
146
150 //Vector<double> ke;
151 //Vector<double> ns;
152
153 double dd;
154 double ni;
155 int illum;
156
158
159public:
160 void init(void);
161 void free(void);
162 void delete_next(void);
163 void setup_params(void);
164};
165
166
167}
168
169#endif
回転・クォータニオン ライブラリ ヘッダ
三角Contour(Facet)用ライブラリ ヘッダ for BREP
void dup(AffineTrans a)
OBJFacetMtlNode * mtl_node
Definition OBJDataTool.h:65
void setUE(bool b)
Definition OBJDataTool.h:73
OBJData(int n=0)
Definition OBJDataTool.h:47
OBJData * next
Definition OBJDataTool.h:63
Vector< double > execAffineTrans(void)
void outputFile(const char *fn, const char *out_path, const char *tex_dirn, const char *mtl_dirn)
void setAffineTrans(AffineTrans< double > a)
Definition OBJDataTool.h:76
void delete_next(void)
void delAffineTrans(void)
Definition OBJDataTool.h:77
void init(int n)
AffineTrans< double > * affineTrans
Definition OBJDataTool.h:61
OBJFacetGeoNode * geo_node
Definition OBJDataTool.h:64
void addShell(MeshObjectData *shelldata, bool collider)
void closeSolid(void)
Definition OBJDataTool.h:83
void output_mtl(char *fn, char *out_dirn, char *tex_dirn, char *bin_dirn)
void output_obj(char *fn, char *out_dirn, char *tex_dirn, char *bin_dirn)
void free(void)
void setEngine(int)
Buffer obj_name
Definition OBJDataTool.h:51
void setUnity(bool b)
Definition OBJDataTool.h:72
virtual ~OBJData(void)
Definition OBJDataTool.h:48
UVMap< double > * vt
Vector< double > * vv
Vector< double > * vn
AffineTrans< double > * uvmap_trans
OBJFacetGeoNode * next
virtual ~OBJFacetGeoNode(void)
Vector< double > ka
Vector< double > ks
MaterialParam material_param
virtual ~OBJFacetMtlNode(void)
Vector< double > kd
OBJFacetMtlNode * next
Definition Brep.h:29
void freeAffineTrans(AffineTrans< T > *&affine)
void freeOBJData(OBJData *obj)
Definition OBJDataTool.h:96
ツールライブラリ ヘッダ for C++
Tiny XML ライブラリヘッダ