NX Open C++ 参考指南 2406 v1.1
载入中...
搜索中...
未找到
LightCollection.hxx
1//--------------------------------------------------------------------------
2// Copyright 2024 Siemens
3//--------------------------------------------------------------------------
4// C++接口至JA API的头文件
5//--------------------------------------------------------------------------
6//
7// 源文件:
8// LightCollection.ja
9//
10// 生成工具:
11// apiwrap
12//
13// 警告:
14// 此文件由自动生成 - 请勿手动编辑
15//
16#pragma once
17#include <NXOpen/NXDeprecation.hxx>
18#include <iterator>
19#include <vector>
20#include <NXOpen/NXString.hxx>
21#include <NXOpen/Callback.hxx>
22#include <NXOpen/TaggedObjectCollection.hxx>
23#include <NXOpen/TaggedObject.hxx>
24#include <NXOpen/libnxopencpp_exports.hxx>
25#ifdef _MSC_VER
26#pragma warning(push)
27#pragma warning(disable:4996)
28#endif
29#ifdef __GNUC__
30#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
31#endif
32namespace NXOpen
33{
34 class LightCollection;
35 class BasePart;
36 class Light;
37 class LightCollectionImpl;
43 class NXOPENCPPEXPORT LightCollection : public NXOpen::TaggedObjectCollection
44 {
45 private: LightCollectionImpl * m_lightcollection_impl;
46 private: NXOpen::BasePart* m_owner;
48 public: explicit LightCollection(NXOpen::BasePart *owner);
50 public:
52 tag_t Tag() const;
53 public: ~LightCollection();
55 //lint -sem(NXOpen::LightCollection::iterator::copy,initializer)
56 class iterator : public std::iterator<std::forward_iterator_tag, NXOpen::Light *>
57 {
58 public:
60 iterator() : m_context(nullptr), m_current(NULL_TAG)
61 {
62 // coverity[uninit_member]
63 } //lint !e1401 m_state未初始化
64
65 explicit iterator(NXOpen::LightCollection *context) : m_context(context), m_current(NULL_TAG)
66 {
67 // coverity[uninit_member]
68 }//lint !e1401 m_state未初始化
70
71 iterator(const iterator &other): m_context(nullptr), m_current(NULL_TAG)
72 {
73 copy(other);
74 }
75
76 iterator &operator =(const iterator &other)
77 {
78 if (&other != this)
79 copy(other);
80 return *this;
81 }
82
83 bool operator ==(const iterator &other) const
84 {
85 return m_current == other.m_current && m_context == other.m_context;
86 }
87
88 bool operator !=(const iterator &other) const
89 {
90 return !operator == (other);
91 }
92
93 NXOPENCPPEXPORT value_type operator * () const;
95 iterator & operator ++()
96 {
97 next();
98 return *this;
99 }
100
101 iterator operator ++(int)
102 {
103 iterator tmp(*this);
104 ++*this;
105 return tmp;
106 }
107 private:
108 void copy(const iterator &other)
109 {
110 m_context = other.m_context;
111 m_current = other.m_current;
112 for (int i = 0; i < sizeof(m_state)/sizeof(m_state[0]); i++)
113 m_state[i] = other.m_state[i];
114 }
115 NXOPENCPPEXPORT void next();
116 NXOpen::LightCollection *m_context;
117 tag_t m_current;
118 unsigned int m_state[8];
119 };
120
124 {
125 return iterator(this);
126 }
127
132 (
133 const NXString & journalIdentifier
134 );
140 (
141 const char * journalIdentifier
142 );
147 (
148 const std::vector<NXOpen::Light *> & lights ,
149 const std::vector<double> & intensities
150 );
151 }; //lint !e1712 类未定义默认构造函数
152}
153#ifdef _MSC_VER
154#pragma warning(pop)
155#endif
156#ifdef __GNUC__
157#ifndef NX_NO_GCC_DEPRECATION_WARNINGS
158#pragma GCC diagnostic warning "-Wdeprecated-declarations"
159#endif
160#endif
161#undef EXPORTLIBRARY