Rigs of Rods 2023.09
Soft-body Physics Simulation
All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
Loading...
Searching...
No Matches
RigDef_Validator.h
Go to the documentation of this file.
1/*
2 This source file is part of Rigs of Rods
3 Copyright 2005-2012 Pierre-Michel Ricordel
4 Copyright 2007-2012 Thomas Fischer
5 Copyright 2013-2020 Petr Ohlidal
6
7 For more information, see http://www.rigsofrods.org/
8
9 Rigs of Rods is free software: you can redistribute it and/or modify
10 it under the terms of the GNU General Public License version 3, as
11 published by the Free Software Foundation.
12
13 Rigs of Rods is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 GNU General Public License for more details.
17
18 You should have received a copy of the GNU General Public License
19 along with Rigs of Rods. If not, see <http://www.gnu.org/licenses/>.
20*/
21
34#pragma once
35
36#include "RigDef_File.h"
37
38#include <memory>
39#include <OgreString.h>
40
41namespace RigDef
42{
43
48{
49public:
50
51 struct Message // TODO: remove, use console API directly
52 {
62 };
63
67 void Setup(RigDef::DocumentPtr file);
68
73 bool AddModule(Ogre::String const & module_name);
74
75 bool Validate();
76
77 void SetCheckBeams(bool check_beams)
78 {
79 m_check_beams = check_beams;
80 }
81
82private:
83
88
92 bool CheckGearbox();
93
94 void AddMessage(Validator::Message::Type type, Ogre::String const & text);
95
96/* -------------------------------------------------------------------------- */
97/* Individual section checkers. */
98/* -------------------------------------------------------------------------- */
99
100 bool CheckShock2(RigDef::Shock2 & shock2);
101
102 bool CheckShock3(RigDef::Shock3 & shock3);
103
105
106 bool CheckCommand(RigDef::Command2 & def);
107
108 bool CheckTrigger(RigDef::Trigger & def);
109
114
115 bool CheckFlare2(RigDef::Flare2 & def);
116
117/* -------------------------------------------------------------------------- */
118/* Properties */
119/* -------------------------------------------------------------------------- */
120
122 std::list<std::shared_ptr<RigDef::Document::Module>> m_selected_modules;
124
125};
126
127} // namespace RigDef
Data structures representing 'truck' file format, see https://docs.rigsofrods.org/vehicle-creation/fi...
Performs a formal validation of the file (missing required parts, conflicts of modules,...
void Setup(RigDef::DocumentPtr file)
Prepares the validation.
RigDef::DocumentPtr m_file
The parsed input file.
bool CheckVideoCamera(RigDef::VideoCamera &def)
Section 'videocamera'.
void AddMessage(Validator::Message::Type type, Ogre::String const &text)
bool CheckAnimator(RigDef::Animator &def)
bool CheckFlare2(RigDef::Flare2 &def)
bool CheckTrigger(RigDef::Trigger &def)
bool CheckShock3(RigDef::Shock3 &shock3)
bool CheckShock2(RigDef::Shock2 &shock2)
void SetCheckBeams(bool check_beams)
bool AddModule(Ogre::String const &module_name)
Adds a vehicle module to the validated configuration.
std::list< std::shared_ptr< RigDef::Document::Module > > m_selected_modules
bool CheckSectionSubmeshGroundmodel()
Inline-ection 'submesh_groundmodel', unique across all modules.
bool CheckCommand(RigDef::Command2 &def)
bool CheckGearbox()
Checks there's at least 1 forward gear.
std::shared_ptr< Document > DocumentPtr