10 #ifndef __MQSDKPlugIn0x_11_h__
11 #define __MQSDKPlugIn0x_11_h__
13 #define _USE_MATH_DEFINES
28 #define WIN32_LEAN_AND_MEAN
31 #include <MQSetting.h>
32 #include <MQBasePlugin.h>
36 #include "impl/MQ0x_11.hpp"
39 #ifdef MQPLUGIN_VERSION
40 #if MQPLUGIN_VERSION < 0x0300
41 "MQx" need newer than mqsdk300
44 "MQx" need newer than mqsdk300
90 if ( pSrc != NULL )
for (
size_t i = 0; i < ct; i++ ) m_val = (m_val * (T_OUT)(
sizeof(T_IN) * 8 - 1)) ^ pSrc[i];
109 if ( pSrc != NULL )
while ( (*pSrc) != trailCode ) ret.m_val = (ret.m_val * (T_OUT)(
sizeof(T_IN) * 8 - 1)) ^ (*(pSrc++));
113 operator T_OUT() {
return m_val; }
120 template <
typename T>
struct HSV {
126 HSV(T h_, T s_, T v_) :
h(h_),
s(s_),
v(v_) {}
128 HSV(
const MQColor& rgb ) :
h(T(0)),
s(T(0)),
v(T(0)) {
130 const T min = T(std::min(std::min(rgb.r,rgb.g),rgb.b));
131 const T max = T(std::max(std::max(rgb.r,rgb.g),rgb.b));
132 const T delta = max - min;
136 if ( rgb.r == max )
h = (rgb.g-rgb.b) / delta;
137 else if (rgb.g == max)
h = T(2) + (rgb.b-rgb.r) / delta;
138 else h = T(4) + (rgb.r-rgb.g) / delta;
140 if (
h < T(0) )
h += T(1);
161 const T H = normal.
h * T(6);
162 const int Hi =
static_cast<int>(H);
163 const T fr = H - T(Hi);
164 const T m = normal.
v * (T(1)-normal.
s);
165 const T n = normal.
v * (T(1)-normal.
s*fr);
166 const T p = normal.
v * (T(1)-normal.
s*(T(1)-fr));
168 case 0:
return MQColor(
float(normal.
v),
float(p),
float(m) );
169 case 1:
return MQColor(
float(n),
float(normal.
v),
float(m) );
170 case 2:
return MQColor(
float(m),
float(normal.
v),
float(p) );
171 case 3:
return MQColor(
float(m),
float(n),
float(normal.
v) );
172 case 4:
return MQColor(
float(p),
float(m),
float(normal.
v) );
173 default:
return MQColor(
float(normal.
v),
float(m),
float(n) );
199 template <
typename T_MQPLUGIN>
friend class PluginBase;
203 Handle( MQBasePlugin* plugin ) { this->plugin = plugin; }
204 MQBasePlugin* plugin;
209 bool Load(
const char *name,
bool& value,
bool default_value=
false);
210 bool Load(
const char *name,
int& value,
int default_value=0);
211 bool Load(
const char *name,
unsigned int& value,
unsigned int default_value=0);
212 bool Load(
const char *name,
float& value,
float default_value=0.0f);
213 bool Load(
const char *name, std::string& value, std::string default_value=
"");
214 bool Save(
const char *name,
const bool& value);
215 bool Save(
const char *name,
const int& value);
216 bool Save(
const char *name,
const unsigned int& value);
217 bool Save(
const char *name,
const float& value);
218 bool Save(
const char *name,
const char* value);
219 bool Save(
const char *name,
const std::string& value);
223 MQBasePlugin* m_plugin;
224 MQSetting* m_setting;
262 template <
typename T_MQPLUGIN>
class PluginBase :
public T_MQPLUGIN {
264 PluginBase(
const char* productName,
const char* pluginFullName,
const char* pluginString ) :
265 m_productName( productName ),
266 m_pluginFullName( pluginFullName ),
267 m_pluginString( pluginString ),
273 PluginBase(
const char* productName,
const char* pluginFullName,
const char* pluginString,
274 const DWORD idProduct,
const DWORD idPlugin ) :
275 m_productName( productName ),
276 m_pluginFullName( pluginFullName ),
277 m_pluginString( pluginString ),
278 m_idProduct( idProduct ),
279 m_idPlugin( idPlugin )
285 *Product = m_idProduct;
291 virtual const char *
EnumString() {
return m_pluginString.c_str(); }
303 const std::string m_productName;
304 const std::string m_pluginFullName;
305 const std::string m_pluginString;
306 const DWORD m_idProduct;
307 const DWORD m_idPlugin;
315 template <
typename T>
inline T
Ceil( T src ) {
return src; }
317 template <>
inline float Ceil(
float src ) {
return std::ceil(src); }
318 template <>
inline double Ceil(
double src ) {
return std::ceil(src); }
319 template <>
inline long double Ceil(
long double src ) {
return std::ceil(src); }
323 template <
typename T>
inline T
Clamp( T src, T min, T max ) {
324 return std::min( std::max(min,max), std::max( std::min(min,max), src) );
328 template <
typename T>
inline T
Clamp01( T src ) {
return std::min(T(1),std::max(T(0),src)); }
331 template <
typename T>
inline T
Floor( T src ) {
return src; }
333 template <>
inline float Floor(
float src ) {
return std::floor(src); }
334 template <>
inline double Floor(
double src ) {
return std::floor(src); }
335 template <>
inline long double Floor(
long double src ) {
return std::floor(src); }
340 template <
typename T>
inline T
Lerp(T from, T to, T t) {
return from + (to - from) * clamp01(t); }
343 template <
typename T>
inline T
MoveTo( T from, T to, T mov ) {
345 if ( std::abs(from - to) < mov )
return to;
346 return from += ( from < to ? mov : -mov );
350 template <
typename T>
inline T
Pi() {
return (T)M_PI; }
352 template <>
long double Pi();
360 template <
typename T>
inline T
Deg2Rad() {
return Pi<T>() / (T)180; }
362 template <
typename T>
inline T
Deg2Rad(T degree) {
return Deg2Rad<T>() * degree; }
369 template <
typename T>
inline T
Rad2Deg() {
return (T)180 / Pi<T>(); }
374 template <
typename T>
inline T
Repeat( T t, T length ) {
return t - std::floor(t/length)*length; }
377 template <
typename T>
inline T
Trunc( T src ) {
if ( T(0) < src )
return floor(src);
return ceil(src); }
380 using namespace Math;
388 struct VertexNormalBuffer;
396 typedef std::vector<MQPoint>::size_type size_type;
398 static bool IsInvalid(
const MQPoint& src ) {
return src.x >= std::numeric_limits<float>::infinity(); }
400 FaceNormalBuffer() : m_obj(NULL), m_buffer(0), invalid_value( std::numeric_limits<float>::infinity(), std::numeric_limits<float>::infinity(), std::numeric_limits<float>::infinity() ) {}
403 invalid_value( std::numeric_limits<float>::infinity(), std::numeric_limits<float>::infinity(), std::numeric_limits<float>::infinity() ) {
405 const int ctFaceMax = obj->GetFaceCount();
406 m_buffer.resize( ctFaceMax );
407 for (
int ctFace = 0; ctFace < ctFaceMax; ctFace++ ) m_buffer[ctFace].x = invalid_value.x;
413 void Clear(
const bool isCompact =
false ) {
415 size_type sz = 0;
if ( m_obj != NULL ) sz = size_type(m_obj->GetFaceCount());
416 std::vector<MQPoint>(sz).swap( m_buffer );
418 for ( size_type ctFace = 0; ctFace < m_buffer.size(); ctFace++ ) m_buffer[ctFace].x = invalid_value.x;
423 void Clear( const ::MQObject obj,
const bool isCompact =
false ) { m_obj = obj;
Clear(isCompact); }
426 size_type sz = 0;
if ( m_obj != NULL ) sz = size_type(m_obj->GetFaceCount());
428 m_buffer.shrink_to_fit();
431 const ::MQObject
MQObject()
const {
return m_obj; }
438 const MQPoint& operator [] ( size_type index ) {
439 if ( m_obj == NULL ) {
440 if ( (index < m_buffer.size()) && (IsInvalid(m_buffer[index])==
false) )
return m_buffer[index];
443 const size_type ctFaceMax = size_type(m_obj->GetFaceCount());
444 if ( index < ctFaceMax ) {
445 const size_type registedSize = m_buffer.size();
446 if ( registedSize < ctFaceMax ) {
447 m_buffer.resize( ctFaceMax );
448 for ( size_type ct = registedSize; ct < ctFaceMax; ct++ ) m_buffer[ct].x = invalid_value.x;
450 if ( IsInvalid(m_buffer[index]) ) {
451 const int ctFacePointMax = m_obj->GetFacePointCount( index );
452 if ( (ctFacePointMax==3) || (ctFacePointMax==4) ) {
454 m_obj->GetFacePointArray( index, v );
455 if ( ctFacePointMax==3 )
456 m_buffer[index] = GetNormal( m_obj->GetVertex(v[0]), m_obj->GetVertex(v[1]), m_obj->GetVertex(v[2]) );
457 else if ( ctFacePointMax==4 )
458 m_buffer[index] = GetQuadNormal( m_obj->GetVertex(v[0]), m_obj->GetVertex(v[1]), m_obj->GetVertex(v[2]), m_obj->GetVertex(v[3]) );
461 return m_buffer[index];
464 return invalid_value;
470 const MQPoint invalid_value;
472 std::vector<MQPoint> m_buffer;
480 typedef std::vector<MQPoint>::size_type size_type;
482 static bool IsInvalid(
const MQPoint& src ) {
return FaceNormalBuffer::IsInvalid(src); }
486 VertexNormalBuffer( const ::MQObject obj ) : m_face_normals( obj ), m_buffer(0) {
if (obj != NULL) Clear(obj); }
490 void Clear(
const bool isCompact =
false ) {
493 if ( m_face_normals.m_obj != NULL ) sz = size_type(m_face_normals.m_obj->GetVertexCount());
494 std::vector<MQPoint>(sz).swap( m_buffer );
496 for ( size_type ctFace = 0; ctFace < m_buffer.size(); ctFace++ ) m_buffer[ctFace].x = m_face_normals.invalid_value.x;
497 m_face_normals.Clear(isCompact);
502 void Clear( const ::MQObject obj,
const bool isCompact =
false ) {
504 size_type sz = 0;
if ( obj != NULL ) sz = size_type(obj->GetVertexCount());
505 std::vector<MQPoint>(sz).swap( m_buffer );
507 for ( size_type ctFace = 0; ctFace < m_buffer.size(); ctFace++ ) m_buffer[ctFace].x = m_face_normals.invalid_value.x;
508 m_face_normals.Clear(obj,isCompact);
514 if ( m_face_normals.m_obj != NULL ) sz = size_type(m_face_normals.m_obj->GetVertexCount());
516 m_buffer.shrink_to_fit();
517 m_face_normals.Compact();
526 const MQPoint&
FaceNormal( FaceNormalBuffer::size_type index ) {
return m_face_normals[index]; }
528 const ::MQObject
MQObject()
const {
return m_face_normals.MQObject(); }
536 if ( m_face_normals.m_obj == NULL ) {
537 if ( (index < m_buffer.size()) && (IsInvalid(m_buffer[index])==
false) )
return m_buffer[index];
540 const size_type ctVertexMax = size_type(m_face_normals.m_obj->GetVertexCount());
541 if ( index < ctVertexMax ) {
542 const size_type registedSize = m_buffer.size();
543 if ( registedSize < ctVertexMax ) {
544 m_buffer.resize( ctVertexMax );
545 for ( size_type ct = registedSize; ct < ctVertexMax; ct++ ) m_buffer[ct].x = m_face_normals.invalid_value.x;
547 MQPoint& ret = m_buffer[index];
548 if ( IsInvalid(ret) ) {
549 const std::vector<int>::size_type ctFaceMax = std::vector<int>::size_type(m_face_normals.m_obj->GetVertexRelatedFaces( index, NULL ));
553 m_face_normals.m_obj->GetVertexRelatedFaces( index, &face_index );
554 ret = FaceNormal(FaceNormalBuffer::size_type(face_index));
556 else if ( 1 < ctFaceMax ) {
557 std::vector<int> face_indexes( ctFaceMax );
558 std::vector<int> vertexIndexesOfFace(4);
559 m_face_normals.m_obj->GetVertexRelatedFaces( index, &face_indexes[0] );
560 unsigned int ctAdd = 0;
562 for ( std::vector<int>::size_type ct = 0; ct < ctFaceMax; ct++ )
564 const MQPoint& n = FaceNormal(FaceNormalBuffer::size_type(face_indexes[ct]));
565 if ( FaceNormalBuffer::IsInvalid(n) ==
false )
567 const std::vector<int>::size_type vertexCountOfFace = std::vector<int>::size_type(m_face_normals.m_obj->GetFacePointCount(face_indexes[ct]));
568 if (vertexIndexesOfFace.size() < vertexCountOfFace) vertexIndexesOfFace.resize(vertexCountOfFace);
569 m_face_normals.m_obj->GetFacePointArray(face_indexes[ct], &vertexIndexesOfFace[0]);
571 std::vector<int>::size_type findPosition;
572 for (std::vector<int>::size_type ct = 0; ct < vertexCountOfFace; ct++)
574 if (index == vertexIndexesOfFace[ct])
if (findCt++ == 0) findPosition = ct;
576 if (findCt != 1)
continue;
577 const int prevVertexIndex = vertexIndexesOfFace[(findPosition <= 0 ? vertexCountOfFace : findPosition) - 1];
578 const int nextVertexIndex = vertexIndexesOfFace[(findPosition + 1) < vertexCountOfFace ? (findPosition + 1) : 0];
579 const MQPoint vertex = m_face_normals.m_obj->GetVertex(index);
580 MQPoint toPrevVertex = m_face_normals.m_obj->GetVertex(prevVertexIndex) - vertex;
581 MQPoint toNextVertex = m_face_normals.m_obj->GetVertex(nextVertexIndex) - vertex;
582 float cos = GetInnerProduct(toPrevVertex, toNextVertex) / (GetSize(toPrevVertex) * GetSize(toNextVertex));
583 ret += (n * (1.0f - cos));
587 if (0 < ctAdd) ret.normalize();
588 else ret.x = m_face_normals.invalid_value.x;
594 return m_face_normals.invalid_value;
597 const MQPoint& operator [] ( size_type index ) {
return VertexNormal(index); }
600 std::vector<MQPoint> m_buffer;
610 UVPoint(
const MQCoordinate& initial_uv ) : uv(initial_uv) {}
620 typedef std::vector<UVPoint> base_buffer_type;
621 base_buffer_type m_buffer[resolution];
629 struct Index :
public std::pair<resolution_type, base_buffer_type::size_type> {
633 typedef std::pair<resolution_type, base_buffer_type::size_type> base_type;
636 Index(
resolution_type first, base_buffer_type::size_type second ) : base_type(first, second) {}
638 base_buffer_type::size_type second()
const {
return base_type::second; }
643 if ( ( index.first() <
resolution ) && ( index.second() < m_buffer[index.first()].size() ) )
return &(m_buffer[index.first()][index.second()]);
650 const float abs_e = std::abs(epsilon);
652 const base_buffer_type::size_type size = m_buffer[first].size();
653 for ( base_buffer_type::size_type ct = 0; ct < size; ct++ ) {
654 const MQCoordinate& buffer_uv = m_buffer[first][ct].uv;
655 if ( (std::abs(uv.u - buffer_uv.u) < abs_e) && (std::abs(uv.v - buffer_uv.v) < abs_e) )
return Index( first, ct );
657 m_buffer[first].push_back(
UVPoint(uv) );
658 return Index( first, size );
662 void Clear(
const bool isCompact =
false ) {
664 if ( isCompact ) base_buffer_type().swap( m_buffer[ct] );
665 else m_buffer[ct].clear();
686 typedef std::vector<Face> buffer_type;
690 typedef buffer_type::size_type
Index;
695 typedef std::vector<Index>::size_type
Index;
704 if ( Contains( index, &ret ) ==
false ) {
705 ret = m_buffer.size();
706 m_buffer.push_back(index);
714 for (
Index index = 0; index < m_buffer.size(); index++ ) {
715 if ( m_buffer[index] == src ) {
if ( find_index != NULL ) *find_index = index;
return true; }
724 std::vector<Face::Buffer::Index> m_buffer;
727 const Face* operator [] (
Index index )
const {
if ( index < m_buffer.size() )
return &m_buffer[index];
return NULL; }
729 void Add(
const Face& add_item ) { m_buffer.push_back( add_item ); }
733 void Clear(
const bool isCompact =
false ) {
if ( isCompact ) std::vector<Face>().swap( m_buffer );
else m_buffer.clear(); }
743 buffer_type m_buffer;
753 for ( std::size_t ct = 0; ct < m_szPoints; ct++ )
if ( m_points[ct].index == search_index )
return (m_points + ct);
757 const Point&
Points(std::size_t index)
const {
return m_points[index]; }
758 Face() : m_szPoints(0) {}
763 std::size_t m_szPoints;
764 Face::Point m_points[4];
774 struct VertexPair :
public std::pair<UVPoint::Buffer::Index, UVPoint::Buffer::Index> {
775 typedef std::pair<UVPoint::Buffer::Index, UVPoint::Buffer::Index> base_type;
777 : base_type( std::min(first, second), std::max(first, second) ) {}
782 if ( pSrc != NULL ) {
783 if ( pSrc[0] < pSrc[1] ) {
784 base_type::first = pSrc[0];
785 base_type::second = pSrc[1];
788 base_type::first = pSrc[1];
789 base_type::second = pSrc[0];
795 VertexPair& operator = (
const VertexPair& src ) { base_type::first = src[0]; base_type::second = src[1];
return *
this; }
808 typedef std::vector<Edge> buffer_type;
815 void Clear(
const bool isCompact =
false ) {
if ( isCompact ) std::vector<Edge>().swap( m_buffer );
else m_buffer.clear(); }
820 buffer_type m_buffer;
823 Edge(
const VertexPair& v_pair,
Face::Buffer::Index face_index ) : m_vertex_pair(v_pair) { m_owner_faces.Add(face_index); }
824 Edge(
const UVPoint::Buffer::Index* pSrc, Face::Buffer::Index face_index ) : m_vertex_pair(pSrc) {
825 if ( pSrc != NULL ) m_owner_faces.Add(face_index);
828 bool operator == (
const VertexPair& src )
const {
return (
const VertexPair::base_type&)m_vertex_pair == (
const VertexPair::base_type&)src; }
844 VertexPair m_vertex_pair;
860 bool operator()( MQCoordinate*
const uv_coorinates, DWORD*
const colors,
861 const MQObject obj,
const int count_of_points,
const int face_index,
const UINT face_uid ) {
return true; }
877 bool operator()( MQCoordinate*
const uv_coorinates, DWORD*
const colors,
878 const MQObject obj,
const int count_of_points,
const int face_index,
const UINT face_uid,
879 const MQPoint& normal, MQPoint*
const point_normals ) {
return true; }
883 _NormaledCoordinateTransformFunctor functor;
886 MQCoordinate*
const uv_coorinates, DWORD*
const colors,
887 const MQObject obj,
const int count_of_points,
const int face_index,
const UINT face_uid )
889 MQPoint v_normal_buffer[4];
890 int v_index_buffer[4];
891 obj->GetFacePointArray( face_index, v_index_buffer );
892 for (
int ctFacePoint = 0; ctFacePoint < count_of_points; ctFacePoint++ ) {
893 v_normal_buffer[ctFacePoint] = m_normal_buffer.VertexNormal( VertexNormalBuffer::size_type(v_index_buffer[ctFacePoint]) );
895 return functor( uv_coorinates, colors, obj, count_of_points, face_index, face_uid, m_normal_buffer.FaceNormal(face_index), v_normal_buffer );
907 template <
class _BasicUVTransformFunctor>
void AddObject(
const MQObject obj, _BasicUVTransformFunctor& coordinateTrans ) {
908 if ( obj == NULL )
return;
909 MQCoordinate coordinate_buffer[4];
910 DWORD vertex_color_buffer[4];
912 const int ctFaceMax = obj->GetFaceCount();
913 const UINT obj_uid = obj->GetUniqueID();
914 const float eps = m_epsilon;
917 for (
int ctFace = 0; ctFace < ctFaceMax; ctFace++ ) {
918 const UINT uidFace = obj->GetFaceUniqueID( ctFace );
919 const int ctFacePointMax = obj->GetFacePointCount( ctFace );
920 if ( (ctFacePointMax<3)||(4<ctFacePointMax) )
continue;
921 obj->GetFaceCoordinateArray( ctFace, coordinate_buffer );
922 for (
int ctFacePoint = 0; ctFacePoint < ctFacePointMax; ctFacePoint++ ) {
923 vertex_color_buffer[ctFacePoint] = obj->GetFaceVertexColor( ctFace, ctFacePoint );
925 if ( coordinateTrans( coordinate_buffer, vertex_color_buffer, obj, ctFacePointMax, ctFace, uidFace ) ==
false )
continue;
927 add_face.m_szPoints = ctFacePointMax;
928 for (
int ctFacePoint = 0; ctFacePoint < ctFacePointMax; ctFacePoint++ ) {
929 add_face.m_points[ctFacePoint].
index = m_uv_buffer.GetIndexOf( coordinate_buffer[ctFacePoint], eps );
930 add_face.m_points[ctFacePoint].
color = vertex_color_buffer[ctFacePoint];
932 m_face_buffer.Add(add_face);
933 for (
int ctFacePoint = 0; ctFacePoint < ctFacePointMax; ctFacePoint++ ) {
934 int ctFacePointNext = (ctFacePoint < (ctFacePointMax-1)) ? ctFacePoint + 1 : 0;
936 m_edge_buffer.Add( add_edge, m_face_buffer.Count()-1 );
943 template <
class _BasicUVTransformFunctor>
void AddObjectRecursive(
const MQDocument doc,
const MQObject obj, _BasicUVTransformFunctor& coordinateTrans)
945 if ( (doc == NULL) || (obj == NULL) )
return;
946 AddObject( obj, coordinateTrans );
947 const int ctChild = doc->GetChildObjectCount(obj);
948 for (
int indexCh = 0; indexCh < ctChild; indexCh++ ) AddObjectRecursive( doc, doc->GetChildObject( obj, indexCh ), coordinateTrans );
955 void Clear(
const bool isCompact =
false ) { m_edge_buffer.Clear(isCompact); m_face_buffer.Clear(isCompact); m_uv_buffer.Clear(isCompact); }
957 void Compact() { m_uv_buffer.Compact(); m_face_buffer.Compact(); m_edge_buffer.Compact(); }
963 float Epsilon(
float setValue ) {
return m_epsilon = std::abs(setValue); }
973 UVPoint::Buffer m_uv_buffer;
974 Face::Buffer m_face_buffer;
975 Edge::Buffer m_edge_buffer;
981 inline void UVFaceBuffer::Edge::Buffer::Add(
const Edge::VertexPair& vertex_pair,
const Face::Buffer::Index& index ) {
982 for ( buffer_type::iterator itr = m_buffer.begin(); itr != m_buffer.end(); itr++ ) {
983 if ( *itr == vertex_pair ) { itr->m_owner_faces.Add( index );
return; }
985 m_buffer.push_back( Edge(vertex_pair, index ) );
1003 int index = prv_impl::GetIdentifiedIndex(doc, mat);
1004 if ( index < 0 )
return false;
1005 doc->DeleteMaterial(index);
return true;
1010 int index = prv_impl::GetIdentifiedIndex(doc, obj);
1011 if ( index < 0 )
return false;
1012 doc->DeleteObject(index);
return true;
1046 inline MQMaterial
GetMaterial(
const MQDocument doc,
const char* name ) {
return prv_impl::GetNamed<MQMaterial>( doc, name ); }
1051 inline MQMaterial
GetMaterial(
const MQDocument doc,
const UINT
id ) {
1052 #if 0x0310 <= MQPLUGIN_VERSION
1053 if ( doc != NULL )
return doc->GetMaterialFromUniqueID(
id);
1056 return prv_impl::GetIdentified<MQMaterial>( doc, id );
1070 inline int GetMaterialIndex(
const MQDocument doc,
const char* name ) {
return prv_impl::GetNamedIndex<MQMaterial>( doc, name ); }
1073 inline int GetMaterialIndex(
const MQDocument doc,
const UINT
id ) {
return prv_impl::GetIdentifiedIndex<MQMaterial>( doc, id ); }
1084 std::vector<char> buf;
1086 return std::string(&buf[0]);
1098 inline MQObject
GetObject(
const MQDocument doc,
const char* name ) {
return prv_impl::GetNamed<MQObject>( doc, name ); }
1103 inline MQObject
GetObject(
const MQDocument doc,
const UINT
id ) {
1104 #if 0x0310 <= MQPLUGIN_VERSION
1105 if ( doc != NULL )
return doc->GetObjectFromUniqueID(
id);
1108 return prv_impl::GetIdentified<MQObject>(doc, id );
1113 inline int GetObjectIndex(
const MQDocument doc,
const char* name ) {
return prv_impl::GetNamedIndex<MQObject>( doc, name ); }
1116 inline int GetObjectIndex(
const MQDocument doc,
const UINT
id ) {
return prv_impl::GetIdentifiedIndex<MQObject>(doc, id ); }
1118 #if 0x0310 <= MQPLUGIN_VERSION
1124 return prv_impl::GetUnusedNameString<MQMaterial>( doc, base_name );
1131 if ( base_name_material == NULL )
return prv_impl::GetUnusedNameString<MQMaterial>( doc );
1132 return prv_impl::GetUnusedNameString<MQMaterial>( doc,
GetName( base_name_material ).c_str() );
1138 return prv_impl::GetUnusedNameString<MQObject>( doc, base_name );
1145 if ( base_name_object == NULL )
return prv_impl::GetUnusedNameString<MQMaterial>( doc );
1146 return prv_impl::GetUnusedNameString<MQMaterial>( doc,
GetName( base_name_object ).c_str() );
1155 namespace prv_impl {};