SDFormat Editor
Loading...
Searching...
No Matches
OpenFileCommand.h
1/*
2* sdformat-editor
3* Copyright 2025 sdformat-editor
4*
5* Licensed under the Apache License, Version 2.0 (the "License");
6* you may not use this file except in compliance with the License.
7* You may obtain a copy of the License at
8*
9* http://www.apache.org/licenses/LICENSE-2.0
10*
11* Unless required by applicable law or agreed to in writing, software
12* distributed under the License is distributed on an "AS IS" BASIS,
13* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14* See the License for the specific language governing permissions and
15* limitations under the License.
16*
17* Developer: Zaid Duraid, Ean Wheeler, Evan Vokey
18*/
19
20#ifndef SDFORMAT_EDITOR_OPEN_FILE_COMMAND_HH_
21#define SDFORMAT_EDITOR_OPEN_FILE_COMMAND_HH_
22
23
24#include <interfaces/command_interface.h>
25#include <interfaces/sdformat_parser_interface.h>
26#include <interfaces/gui_interface.h>
27
28
31{
32
38 public: OpenFileCommand(std::shared_ptr<GUII> gui, std::shared_ptr<SDFormatParserI> sdformatParser, std::string file_path);
39
42 private: bool Execute() override;
43
46 private: bool ExecuteUndo() override;
47
50 private: bool ExecuteRedo() override;
51
54 private: bool IsUndoable() override;
55
58 private: bool IsRedoable() override;
59
64 private: bool IsThreaded(bool& prevent_user_input) override;
65
68 private: bool ChangesProgramStateIrreversibly() override;
69
71 private: std::string file_path;
72
74 private: std::shared_ptr<GUII> gui;
75
77 private: std::shared_ptr<SDFormatParserI> sdformatParser;
78
79};
80
81#endif
The command class encapsulates the interactions between the various interfaces of the SDFormat Editor...
Definition command_interface.h:29
Open model command implementation of CommandI.
Definition OpenFileCommand.h:31
bool IsThreaded(bool &prevent_user_input) override
Implementation of interface method.
Definition OpenFileCommand.cpp:95
std::string file_path
Filepath of the model.
Definition OpenFileCommand.h:71
std::shared_ptr< SDFormatParserI > sdformatParser
Pointer to the sdformat parser interface.
Definition OpenFileCommand.h:77
bool ExecuteUndo() override
Implementation of interface method.
Definition OpenFileCommand.cpp:85
std::shared_ptr< GUII > gui
Pointer to the gui interface.
Definition OpenFileCommand.h:74
bool Execute() override
Implementation of interface method.
Definition OpenFileCommand.cpp:31
bool ChangesProgramStateIrreversibly() override
Implementation of interface method.
Definition OpenFileCommand.cpp:111
bool ExecuteRedo() override
Implementation of interface method.
Definition OpenFileCommand.cpp:90
bool IsUndoable() override
Implementation of interface method.
Definition OpenFileCommand.cpp:101
bool IsRedoable() override
Implementation of interface method.
Definition OpenFileCommand.cpp:106