vsgXchange: include/vsgXchange/models.h Source File

vsgXchange 1.1.9 VulkanSceneGraph 3rd party data integration library

Loading...
Searching...
No Matches
models.h
1#pragma once
2
3/* <editor-fold desc="MIT License">
4
5Copyright(c) 2021 Robert Osfield
6
7Permission is hereby granted, free of charge, to any person obtaining a copy of
8this software and associated documentation files (the "Software"), to deal in
9the Software without restriction, including without limitation the rights to
10use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
11the Software, and to permit persons to whom the Software is furnished to do so,
12subject to the following conditions:
13
14The above copyright notice and this permission notice shimages be included in images
15copies or substantial portions of the Software.
16
17THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
19FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
20COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
21IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
22CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
23
24</editor-fold> */
25
26#include <vsg/io/ReaderWriter.h>
27#include <vsgXchange/Version.h>
28
29#include <memory>
30
31namespace vsgXchange
32{
34 class VSGXCHANGE_DECLSPEC models : public vsg::Inherit<vsg::CompositeReaderWriter, models>
35 {
36 public:
37 models();
38 };
39
41 class VSGXCHANGE_DECLSPEC assimp : public vsg::Inherit<vsg::ReaderWriter, assimp>
42 {
43 public:
44 assimp();
45 vsg::ref_ptr<vsg::Object> read(const vsg::Path&, vsg::ref_ptr<const vsg::Options>) const override;
46 vsg::ref_ptr<vsg::Object> read(std::istream&, vsg::ref_ptr<const vsg::Options>) const override;
47 vsg::ref_ptr<vsg::Object> read(const uint8_t* ptr, size_t size, vsg::ref_ptr<const vsg::Options> options = {}) const override;
48
49 bool getFeatures(Features& features) const override;
50
51 // vsg::Options::setValue(str, value) supported options:
52 static constexpr const char* generate_smooth_normals = "generate_smooth_normals";
53 static constexpr const char* generate_sharp_normals = "generate_sharp_normals";
54 static constexpr const char* crease_angle = "crease_angle";
55 static constexpr const char* two_sided = "two_sided";
56 static constexpr const char* discard_empty_nodes = "discard_empty_nodes";
57 static constexpr const char* print_assimp = "print_assimp";
58 static constexpr const char* external_textures = "external_textures";
59 static constexpr const char* external_texture_format = "external_texture_format";
60 static constexpr const char* culling = "culling";
61 static constexpr const char* vertex_color_space = "vertex_color_space";
62 static constexpr const char* material_color_space = "material_color_space";
63
64 bool readOptions(vsg::Options& options, vsg::CommandLine& arguments) const override;
65
66 protected:
67 ~assimp();
68
69 class Implementation;
70 Implementation* _implementation;
71 };
72
73} // namespace vsgXchange
74
75EVSG_type_name(vsgXchange::models);
76EVSG_type_name(vsgXchange::assimp);
vsgXchange::assimp
optional assimp ReaderWriter
Definition models.h:42
vsgXchange::assimp::external_texture_format
static constexpr const char * external_texture_format
bool
Definition models.h:59
vsgXchange::assimp::culling
static constexpr const char * culling
TextureFormat enum.
Definition models.h:60
vsgXchange::assimp::vertex_color_space
static constexpr const char * vertex_color_space
bool, insert cull nodes, defaults to true
Definition models.h:61
vsgXchange::assimp::external_textures
static constexpr const char * external_textures
int
Definition models.h:58
vsgXchange::assimp::discard_empty_nodes
static constexpr const char * discard_empty_nodes
bool
Definition models.h:56
vsgXchange::assimp::readOptions
bool readOptions(vsg::Options &options, vsg::CommandLine &arguments) const override
CoordinateSpace {sRGB or LINEAR} to assume when reading materials colors.
vsgXchange::assimp::two_sided
static constexpr const char * two_sided
float
Definition models.h:55
vsgXchange::assimp::material_color_space
static constexpr const char * material_color_space
CoordinateSpace {sRGB or LINEAR} to assume when reading vertex colors.
Definition models.h:62
vsgXchange::assimp::print_assimp
static constexpr const char * print_assimp
bool
Definition models.h:57
vsgXchange::models
Composite ReaderWriter that holds the used 3rd party model format loaders.
Definition models.h:35