JunkBox_Lib++ (for Windows) 1.10.1
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
OBJFacetMtlNode Class Reference

#include <OBJDataTool.h>

Collaboration diagram for OBJFacetMtlNode:

Public Member Functions

 OBJFacetMtlNode ()
 
virtual ~OBJFacetMtlNode (void)
 
void init (void)
 
void free (void)
 
void delete_next (void)
 
void setup_params (void)
 

Public Attributes

Buffer material
 
bool same_material
 
MaterialParam material_param
 
Buffer map_kd
 
Buffer map_ks
 
Buffer map_bump
 
Vector< double > kd
 
Vector< double > ka
 
Vector< double > ks
 
double dd
 
double ni
 
int illum
 
OBJFacetMtlNodenext
 

Detailed Description

Definition at line 132 of file OBJDataTool.h.

Constructor & Destructor Documentation

◆ OBJFacetMtlNode()

OBJFacetMtlNode ( )
inline

Definition at line 135 of file OBJDataTool.h.

135{ this->init();}

References OBJFacetMtlNode::init().

Here is the call graph for this function:

◆ ~OBJFacetMtlNode()

virtual ~OBJFacetMtlNode ( void )
inlinevirtual

Definition at line 136 of file OBJDataTool.h.

136{ this->free();}

References OBJFacetMtlNode::free().

Here is the call graph for this function:

Member Function Documentation

◆ delete_next()

void delete_next ( void )

Definition at line 504 of file OBJDataTool.cpp.

505{
506 if (this->next==NULL) return;
507
508 OBJFacetMtlNode* _next = this->next;
509 while (_next!=NULL) {
510 OBJFacetMtlNode* _curr_node = _next;
511 _next = _next->next;
512 _curr_node->next = NULL;
513 delete(_curr_node);
514 }
515 this->next = NULL;
516}
OBJFacetMtlNode * next

References OBJFacetMtlNode::next.

Referenced by OBJFacetMtlNode::free().

Here is the caller graph for this function:

◆ free()

void free ( void )

Definition at line 492 of file OBJDataTool.cpp.

493{
494 free_Buffer(&(this->material));
495 free_Buffer(&(this->map_kd));
496 free_Buffer(&(this->map_ks));
497 free_Buffer(&(this->map_bump));
498
499 this->material_param.free();
500 this->delete_next();
501}
void free_Buffer(Buffer *buf)
Buffer型変数のバッファ部を解放する
Definition buffer.cpp:128
MaterialParam material_param

References OBJFacetMtlNode::delete_next(), MaterialParam::free(), free_Buffer(), OBJFacetMtlNode::map_bump, OBJFacetMtlNode::map_kd, OBJFacetMtlNode::map_ks, OBJFacetMtlNode::material, and OBJFacetMtlNode::material_param.

Referenced by OBJFacetMtlNode::~OBJFacetMtlNode().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ init()

void init ( void )

Definition at line 470 of file OBJDataTool.cpp.

471{
472 this->same_material = false;
473
474 this->material = init_Buffer();
475 this->map_kd = init_Buffer();
476 this->map_ks = init_Buffer();
477 this->map_bump = init_Buffer();
478 memset(&(this->material_param), 0, sizeof(this->material_param));
479
480 this->ka = Vector<double>(1.0, 1.0, 1.0);
481 this->kd = Vector<double>(1.0, 1.0, 1.0);
482 this->ks = Vector<double>(1.0, 1.0, 1.0);
483
484 this->dd = 1.0;
485 this->ni = 1.0;
486 this->illum = 2;
487
488 this->next = NULL;
489}
Buffer init_Buffer()
初期化したBuffer型変数を返す.
Definition buffer.cpp:47
Vector< double > ka
Vector< double > ks
Vector< double > kd

References OBJFacetMtlNode::dd, OBJFacetMtlNode::illum, init_Buffer(), OBJFacetMtlNode::ka, OBJFacetMtlNode::kd, OBJFacetMtlNode::ks, OBJFacetMtlNode::map_bump, OBJFacetMtlNode::map_kd, OBJFacetMtlNode::map_ks, OBJFacetMtlNode::material, OBJFacetMtlNode::material_param, OBJFacetMtlNode::next, OBJFacetMtlNode::ni, and OBJFacetMtlNode::same_material.

Referenced by OBJFacetMtlNode::OBJFacetMtlNode().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ setup_params()

void setup_params ( void )

Definition at line 519 of file OBJDataTool.cpp.

520{
521 TextureParam texture = this->material_param.texture;
522 TextureParam specmap = this->material_param.specmap;
523 TextureParam bumpmap = this->material_param.bumpmap;
524
525 if (texture.isSetTexture()) { // map_Kd
526 this->map_kd = make_Buffer_str(texture.getName());
528 }
529 if (specmap.isSetTexture()) { // map_Ks
530 this->map_ks = make_Buffer_str(specmap.getName());
532 }
533 if (bumpmap.isSetTexture()) { // map_bump
534 this->map_bump = make_Buffer_str(bumpmap.getName());
536 }
537
538 this->ka = Vector<double>(1.0, 1.0, 1.0);
539 this->kd = texture.getColor();
540 this->ks = specmap.getColor();
541
542 //this->dd = this->material_param.getTransparent();
543 this->dd = texture.getColor(3);
544 this->ni = this->material_param.getShininess()*10.;
545 if (this->ni<1.0) this->ni = 1.0;
546
547 this->illum = 2;
548/*
549 0. Color on and Ambient off
550 1. Color on and Ambient on
551 2. Highlight on
552 3. Reflection on and Ray trace on
553 4. Transparency: Glass on, Reflection: Ray trace on
554 5. Reflection: Fresnel on and Ray trace on
555 6. Transparency: Refraction on, Reflection: Fresnel off and Ray trace on
556 7. Transparency: Refraction on, Reflection: Fresnel on and Ray trace on
557 8. Reflection on and Ray trace off
558 9. Transparency: Glass on, Reflection: Ray trace off
55910. Casts shadows onto invisible surfaces
560*/
561 return;
562}
#define make_Buffer_str(str)
set_Buffer()
Definition buffer.h:61
TextureParam bumpmap
Bumpmap テクスチャ
TextureParam texture
テクスチャ
double getShininess(void)
TextureParam specmap
Specular マップ テクスチャ
char * getName(void)
bool isSetTexture(void)
Vector< double > getColor(void)
#define TRUE
Definition common.h:226
void canonical_filename_Buffer(Buffer *fname, int no_dir)
fname の問題になりそうな ASCII文字を '_' に変換する.
Definition xtools.cpp:2057

References MaterialParam::bumpmap, canonical_filename_Buffer(), OBJFacetMtlNode::dd, TextureParam::getColor(), TextureParam::getName(), MaterialParam::getShininess(), OBJFacetMtlNode::illum, TextureParam::isSetTexture(), OBJFacetMtlNode::ka, OBJFacetMtlNode::kd, OBJFacetMtlNode::ks, make_Buffer_str, OBJFacetMtlNode::map_bump, OBJFacetMtlNode::map_kd, OBJFacetMtlNode::map_ks, OBJFacetMtlNode::material_param, OBJFacetMtlNode::ni, MaterialParam::specmap, MaterialParam::texture, and TRUE.

Here is the call graph for this function:

Member Data Documentation

◆ dd

double dd

◆ illum

int illum

◆ ka

Vector<double> ka

◆ kd

Vector<double> kd

◆ ks

Vector<double> ks

◆ map_bump

◆ map_kd

◆ map_ks

◆ material

Buffer material

◆ material_param

MaterialParam material_param

◆ next

◆ ni

double ni

◆ same_material

bool same_material

Definition at line 140 of file OBJDataTool.h.

Referenced by OBJFacetMtlNode::init(), and OBJData::output_mtl().


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