xcal
基于 C++23 的现代图形渲染引擎
载入中...
搜索中...
未找到
abs_mobject.hpp
浏览该文件的文档.
1
11#pragma once
12#include <xcal/public.h>
13
16
17namespace xcal::mobject {
18
32 private:
37 virtual Type type_() const = 0;
38
39 private:
40 bool_t visible_ = {true};
41 std::vector<property::MProperty*> properties_{};
42
43 protected:
50 template <class... Arg>
51 requires(std::is_base_of_v<property::MProperty, Arg> && ...)
52 void register_properties(Arg&... arg) {
53 (properties_.push_back(static_cast<property::MProperty*>(&arg)), ...);
54 }
55
56 public:
60 AbsMObject() = default;
61
62 public:
67 bool visible() const { return visible_; }
68
73 bool& visible() { return visible_; }
74
75 Type type() const { return type_(); }
76
81 std::vector<property::MProperty*>& properties() { return properties_; }
82
86 virtual ~AbsMObject() = default;
87};
88
92using AbsMObject_ptr = std::unique_ptr<AbsMObject>;
93
94} // namespace xcal::mobject
图形对象命名空间
virtual ~AbsMObject()=default
虚析构函数
std::vector< property::MProperty * > & properties()
获取对象属性列表
bool & visible()
获取对象可见性状态(可修改)
bool visible() const
获取对象可见性状态(只读)
AbsMObject()=default
默认构造函数
std::unique_ptr< AbsMObject > AbsMObject_ptr
抽象图形对象智能指针类型定义
bool bool_t
Definition public.h:28
#define XCAL_API
Definition public.h:69