I got it work, but actually i'm not call PutUserData form inside of a loop. I just create another class and put the data in there
Code: Select all
// thuyPointFromEdge Plugin
// Initial code generated by Softimage SDK Wizard
// Executed Mon Jan 13 15:11:50 UTC+07:00 2018 by Thuy
//
//
// Tip: You need to compile the generated code before you can load the plug-in.
// After you compile the plug-in, you can load it by clicking Update All in the Plugin Manager.
#include <iostream> // std::cout
#include <algorithm> // std::set_difference, std::sort
#include <set> // std::vector
#include <list>
#include <tuple>
#include <cmath>
#include <map>
#include <vector>
#include <xsi_application.h>
#include <xsi_context.h>
#include <xsi_pluginregistrar.h>
#include <xsi_status.h>
#include <xsi_icenodecontext.h>
#include <xsi_icenodedef.h>
#include <xsi_command.h>
#include <xsi_factory.h>
#include <xsi_longarray.h>
#include <xsi_doublearray.h>
#include <xsi_math.h>
#include <xsi_vector2f.h>
#include <xsi_vector3f.h>
#include <xsi_vector4f.h>
#include <xsi_matrix3f.h>
#include <xsi_matrix4f.h>
#include <xsi_rotationf.h>
#include <xsi_quaternionf.h>
#include <xsi_color4f.h>
#include <xsi_floatarray.h>
#include <xsi_shape.h>
#include <xsi_icegeometry.h>
#include <xsi_iceportstate.h>
#include <xsi_indexset.h>
#include <xsi_dataarray.h>
#include <xsi_dataarray2D.h>
// Defines port, group and map identifiers used for registering the ICENode
enum IDs
{
ID_IN_geometry = 0,
ID_ID_pointNeighbors = 1,
//ID_IN_resample_point_count=2,
ID_IN_root_point=3,
ID_IN_root_index = 4,
ID_IN_nextPointIndex = 5,
ID_IN_pPos = 6,
ID_IN_point_normal = 7,
ID_G_100 = 100,
ID_OUT_sample_points = 200,
//ID_OUT_distance = 201,
ID_OUT_upv = 202,
ID_TYPE_CNS = 400,
ID_STRUCT_CNS,
ID_CTXT_CNS,
ID_UNDEF = ULONG_MAX
};
XSI::CStatus RegisterThuyStrandFromEdge(XSI::PluginRegistrar& in_reg);
using namespace XSI;
class CData
{
public:
CData(LONG count,const LONG* vIndecies, const double* normals, const double* positions);
~CData();
std::vector<XSI::MATH::CVector3f> pos_array, nor_array;
int rootSize, step;
};
CData::CData(LONG count,const LONG* vIndecies, const double* normals, const double* positions)
{
for (LONG i = 0; i < count ; i++)
{
MATH::CVector3f v(
(float)positions[vIndecies[i] * 3],
(float)positions[vIndecies[i] * 3 + 1],
(float)positions[vIndecies[i] * 3 + 2]
);
MATH::CVector3f n(
(float)normals[vIndecies[i] * 3],
(float)normals[vIndecies[i] * 3 + 1],
(float)normals[vIndecies[i] * 3 + 2]
);
//app.LogMessage("push pos: " + CString(v));
//app.LogMessage("push normal: " + CString(n));
pos_array.push_back(v);
nor_array.push_back(n);
}
}
//CData::~CData()
//{
// for (int i = 0; i < pos_array.size(); ++i)
// delete pos_array[i];
//}
//=========
//FUNTION
//=========
bool checkEleInArray(CDataArray2DLong::Accessor &inArray, ULONG val);
CStatus getNextIndex(CDataArray2DLong &pointNeighbors, CLongArray &rootIndex, CLongArray &preRoots, CLongArray &result);
CStatus getPointLoop(ULONG &rootIndex, ULONG &nextPointIndex, ULONG &vIndex, CDataArray2DLong &pointNeighbors, CLongArray &result);
CStatus checkPointNeighbors(CLongArray &rootIndex, CDataArray2DLong &pointNeighbors);
CStatus RegisterThuyStrandFromEdge(PluginRegistrar& in_reg)
{
ICENodeDef nodeDef;
nodeDef = Application().GetFactory().CreateICENodeDef(L"ThuyStrandFromEdge", L"Thuy Strand From Edge");
CStatus st;
st = nodeDef.PutColor(188, 188, 188);
st.AssertSucceeded();
// Add input ports and groups.
st = nodeDef.AddPortGroup(ID_G_100);
st.AssertSucceeded();
st = nodeDef.PutThreadingModel(XSI::siICENodeSingleThreading);
st.AssertSucceeded();
st = nodeDef.AddInputPort(
ID_IN_geometry,
ID_G_100,
siICENodeDataGeometry,
siICENodeStructureSingle,
siICENodeContextSingleton,
L"geometry", L"geometry"
);
st.AssertSucceeded();
//st = nodeDef.AddInputPort(
// ID_IN_resample_point_count,
// ID_G_100,
// siICENodeDataLong,
// siICENodeStructureSingle,
// siICENodeContextSingleton,
// L"resample points", L"resample points",
// (LONG)3,
// ID_UNDEF,
// ID_UNDEF,
// ID_UNDEF
// );
//st.AssertSucceeded();
st = nodeDef.AddInputPort(
ID_IN_root_index,
ID_G_100,
siICENodeDataLong,
siICENodeStructureSingle,
siICENodeContextComponent0D,
L"root index", L"root index",
CValue(),
CValue(),
CValue(),
ID_UNDEF,
ID_UNDEF,
ID_CTXT_CNS
);
st.AssertSucceeded();
st = nodeDef.AddInputPort(
ID_IN_nextPointIndex,
ID_G_100,
siICENodeDataLong,
siICENodeStructureSingle,
siICENodeContextSingleton,
L"next point index", L"next point index"/*,
CValue(),
CValue(),
CValue(),
ID_UNDEF,
ID_UNDEF,
ID_CTXT_CNS*/
);
st.AssertSucceeded();
st = nodeDef.AddInputPort(
ID_ID_pointNeighbors,
ID_G_100,
siICENodeDataLong,
siICENodeStructureArray,
siICENodeContextComponent0D,
L"point Neighbors", L"point Neighbors",
(LONG)3,
ID_UNDEF,
ID_UNDEF,
ID_UNDEF
);
st.AssertSucceeded();
st = nodeDef.AddInputPort(
ID_IN_point_normal,
ID_G_100,
siICENodeDataVector3,
siICENodeStructureSingle,
siICENodeContextComponent0D,
L"point normal", L"point normal"
);
st.AssertSucceeded();
st = nodeDef.AddInputPort(
ID_IN_root_point,
ID_G_100,
siICENodeDataVector3,
siICENodeStructureSingle,
siICENodeContextComponent0D,
L"root points", L"root points",
CValue(),
CValue(),
CValue(),
ID_UNDEF,
ID_UNDEF,
ID_CTXT_CNS
);
st.AssertSucceeded();
// Add output ports.
st = nodeDef.AddOutputPort(
ID_OUT_sample_points,
siICENodeDataVector3,
siICENodeStructureArray,
siICENodeContextComponent0D,
L"sample points", L"sample points",
ID_UNDEF,
ID_UNDEF,
ID_CTXT_CNS
);
st.AssertSucceeded();
st = nodeDef.AddOutputPort(
ID_OUT_upv,
siICENodeDataVector3,
siICENodeStructureArray,
siICENodeContextComponent0D,
L"upv", L"upv",
ID_UNDEF,
ID_UNDEF,
ID_CTXT_CNS
);
st.AssertSucceeded();
//st = nodeDef.AddOutputPort(
// ID_OUT_distance,
// siICENodeDataFloat,
// siICENodeStructureArray,
// siICENodeContextComponent0D,
// L"distance", L"distance",
// ID_UNDEF,
// ID_UNDEF,
// ID_CTXT_CNS
//);
//st.AssertSucceeded();
PluginItem nodeItem = in_reg.RegisterICENode(nodeDef);
nodeItem.PutCategories(L"Thuy Custom ICENode");
return CStatus::OK;
}
//set MultiThreading
//XSIPLUGINCALLBACK CStatus ThuyStrandFromEdge_SubmitEvaluationPhaseInfo(ICENodeContext& in_ctxt)
//{
// ULONG nPhase = in_ctxt.GetEvaluationPhaseIndex();
// switch (nPhase)
// {
// case 0:
// {
// in_ctxt.AddEvaluationPhaseInputPort(ID_IN_root_point);
// in_ctxt.AddEvaluationPhaseInputPort(ID_ID_pointNeighbors);
// }
// break;
// case 1:
// {
// in_ctxt.AddEvaluationPhaseInputPort(ID_IN_geometry);
// //in_ctxt.AddEvaluationPhaseInputPort(ID_IN_resample_point_count);
// in_ctxt.AddEvaluationPhaseInputPort(ID_IN_root_index);
// in_ctxt.AddEvaluationPhaseInputPort(ID_IN_nextPointIndex);
// // This phase is the last one. All ports specified for phase 1 will be evaluated in multi-threaded batches.
// in_ctxt.SetLastEvaluationPhase();
// }
// break;
// }
// return CStatus::OK;
//}
XSIPLUGINCALLBACK CStatus ThuyStrandFromEdge_BeginEvaluate(ICENodeContext& in_ctxt)
{
Application app;
CStatus st;
CICEGeometry geom(in_ctxt, ID_IN_geometry);
//CDataArrayLong resamplePointCount(in_ctxt, ID_IN_resample_point_count);
CDataArray2DLong pointNeighbors(in_ctxt, ID_ID_pointNeighbors);
CDataArrayLong inRootIndex(in_ctxt, ID_IN_root_index);
CDataArrayLong inNextPointIndex(in_ctxt, ID_IN_nextPointIndex);
CDataArrayVector3f rootPoints(in_ctxt, ID_IN_root_point);
CDataArrayVector3f inPointNormal(in_ctxt, ID_IN_point_normal);
//get point position
CDoubleArray points;
geom.GetPointPositions(points);
//get transform
MATH::CMatrix4f transfo;
geom.GetTransformation(transfo);
//get point normal
CDoubleArray pointNormal;
for (ULONG i = 0; i < inPointNormal.GetCount(); i++)
{
pointNormal.Add(double(inPointNormal[i][0]));
pointNormal.Add(double(inPointNormal[i][1]));
pointNormal.Add(double(inPointNormal[i][2]));
//app.LogMessage("in Normal_"+CString(inPointNormal[i]));
}
//CREATE USER DATA
//CData *pData = new CData;
//loop though inPoints
//for (size_t i = 0; i < pointNeighbors.GetCount(); i++)
//{
// CDataArray2DLong::Accessor daume = pointNeighbors[i];
// for (size_t x = 0; x < daume.GetCount(); x++)
// {
// app.LogMessage("daume:"+CString(daume[x]));
// }
//}
//app.LogMessage("v_" + CString(rootIndex.GetCount()) + "\n-------");
//================
//get root index
//================
CLongArray roots, vIndecies;
//ULONG rootsIndex = inRootIndex[0];
ULONG nextPointIndex = inNextPointIndex[0];
//check if roots point invalid
//CDataArray2DLong::Accessor startIndex = pointNeighbors[rootsIndex];
//if (startIndex.GetCount() > 2 || !checkEleInArray(startIndex, nextPointIndex)) return CStatus::False;
//find vPoint
//ULONG vIndex;
//startIndex[0] == nextPointIndex ? vIndex = startIndex[1] : vIndex = startIndex[0];
//------------
//--> and now we have -nextPointIndex- and -vIndex- for start to find a next root point :)
//------------
//recursion from roots index to find roots
//roots.Add(rootsIndex);
//roots.Add(nextPointIndex);
//st = getPointLoop(rootsIndex, nextPointIndex, vIndex, pointNeighbors, roots);
for (ULONG i = 0; i < inRootIndex.GetCount(); i++)
{
roots.Add(inRootIndex[i]);
}
//check roots found count
//if (roots.GetCount() != rootPoints.GetCount()) return CStatus::False;
st = checkPointNeighbors(roots, pointNeighbors);
//app.LogMessage("roots: " + CString(roots));
//define step and rootSize
int step, rootSize;
rootSize = roots.GetCount();
//find vIndecies
CLongArray preRoots(rootSize);
for (int i = 0; i < rootSize; i++)
{
preRoots[i] = -1;
vIndecies.Add(roots[i]);
}
if (st == CStatus::OK)
{
//app.LogMessage("dauma!");
st = getNextIndex(pointNeighbors, roots, preRoots, vIndecies);
if (st != CStatus::OK) return CStatus::OK;
//app.LogMessage("vIndecies: " + CString(vIndecies));
step = vIndecies.GetCount() / rootSize;
//CREATE USER DATA
CData *pData = new CData( vIndecies.GetCount(), vIndecies.GetArray(), pointNormal.GetArray(), points.GetArray());
//set step and rootsize
pData->rootSize = rootSize;
pData->step = step;
//for (LONG i = 0; i < vIndecies.GetCount(); i++)
//{
// MATH::CVector3f v(
// (float)points[vIndecies[i] * 3],
// (float)points[vIndecies[i] * 3 + 1],
// (float)points[vIndecies[i] * 3 + 2]
// );
// MATH::CVector3f n(
// (float)pointNormal[vIndecies[i] * 3],
// (float)pointNormal[vIndecies[i] * 3 + 1],
// (float)pointNormal[vIndecies[i] * 3 + 2]
// );
// //app.LogMessage("push pos: " + CString(v));
// //app.LogMessage("push normal: " + CString(n));
// pData->pos_array.push_back(v);
// pData->normal_array.push_back(n);
//}
in_ctxt.PutUserData((CValue::siPtrType) pData);
}
return CStatus::OK;
}
XSIPLUGINCALLBACK CStatus ThuyStrandFromEdge_Evaluate(ICENodeContext& in_ctxt)
{
Application app;
//set MultiThreading
//ULONG nPhase = in_ctxt.GetEvaluationPhaseIndex();
//switch (nPhase)
//{
//case 0:
//{
// return CStatus::OK;
//}
//break;
//};
ULONG out_portID = in_ctxt.GetEvaluatedOutputPortID();
switch (out_portID)
{
case ID_OUT_sample_points:
{
CValue userData = in_ctxt.GetUserData();
if (!userData.IsEmpty())
{
//app.LogMessage("dauma!");
//CREATE USER DATAs
CData *pData = (CData*)(CValue::siPtrType)in_ctxt.GetUserData();
//CDataArrayLong resamplePointCount(in_ctxt, ID_IN_resample_point_count);
CDataArray2DVector3f outData(in_ctxt);
CDataArrayVector3f rootPoints(in_ctxt, ID_IN_root_point);
CIndexSet indexSet(in_ctxt);
//app.LogMessage("dauma_"+CString(indexSet.Indices));
for (CIndexSet::Iterator it = indexSet.Begin(); it.HasNext(); it.Next())
{
CDataArray2DVector3f::Accessor accessor = outData.Resize(it, pData->step);
for (int i = 0; i < pData->step; i++)
{
accessor[i] = pData->pos_array[it + i*pData->rootSize];
//app.LogMessage("id_"+CString(pData->id_array[it + i*pData->rootSize]));
//app.LogMessage("id_"+CString(it + i*pData->rootSize));
//app.LogMessage("it_" + CString(int(it)));
//app.LogMessage("rootsCount_"+CString(rootPoints.GetCount()));
}
}
}
}
break;
case ID_OUT_upv:
{
CValue userData = in_ctxt.GetUserData();
if (!userData.IsEmpty()){
//CREATE USER DATAs
CData *pData = (CData*)(CValue::siPtrType)in_ctxt.GetUserData();
CDataArray2DVector3f outData(in_ctxt);
CDataArrayVector3f rootPoints(in_ctxt, ID_IN_root_point);
CIndexSet indexSet(in_ctxt);
for (CIndexSet::Iterator it = indexSet.Begin(); it.HasNext(); it.Next()){
CDataArray2DVector3f::Accessor accessor = outData.Resize(it, pData->step);
for (int i = 0; i < pData->step; i++){
accessor[i] = pData->nor_array[it + i*pData->rootSize];
//app.LogMessage("normal_"+CString(pData->normal_array[it + i*pData->rootSize]));
}
}
}
}
//break;
//case ID_OUT_distance:
//{
// CValue userData = in_ctxt.GetUserData();
// if (!userData.IsEmpty())
// {
// //////CREATE USER DATAs
// CData *pData = (CData*)(CValue::siPtrType)in_ctxt.GetUserData();
// CDataArray2DFloat outData(in_ctxt);
// CDataArrayVector3f rootPoints(in_ctxt, ID_IN_root_point);
// CIndexSet indexSet(in_ctxt);
// //app.LogMessage("dauma_"+CString(indexSet.Indices));
// CFloatArray distance;
// MATH::CVector3Array center, curPos;
// for (ULONG i = 0; i < pData->pos_array.size(); i++)
// {
// }
// for (CIndexSet::Iterator it = indexSet.Begin(); it.HasNext(); it.Next())
// {
// CDataArray2DFloat::Accessor accessor = outData.Resize(it, pData->step);
// MATH::CVector3f v1,v2,v3;
// MATH::CVector3 v;
// for (int i = 0; i < pData->step; i++)
// {
// v1 = pData->pos_array[it + i*pData->rootSize];
// v.Set(v1[0], v1[1], v1[2]);
// curPos.Add(v);
// if (it + 1 >= pData->rootSize) break;
// v3 = pData->pos_array[it + 1 + i*pData->rootSize];
// v.Set((v3[0]+v1[0])*0.5f, (v3[1]+v[1])*0.5f, (v3[2]+v3[2])*0.5f);
// center.Add(v);
// }
// for (LONG j = 0; j < curPos.GetCount(); j++)
// {
// MATH::CVector3 v, vc1, vc2;
// vc1 = center[j];
// //v = curPos[j];s
// if (j == 0) vc2 = center[j];
// if (j + 1 > (LONG)(center.GetCount())) break;
// vc2 = center[j+1];
// v = vc1;
// v -= vc2;
// distance.Add((float)(v.GetLength()));
// }
// for (int i = 0; i < pData->step; i++)
// {
// app.LogMessage("distance_"+CString(distance[i]));
// //accessor[i] = distance[i];
// }
// }
// }
//}
//break;
};
return CStatus::OK;
}
XSIPLUGINCALLBACK CStatus ThuyStrandFromEdge_EndEvaluate(ICENodeContext& in_ctxt)
{
CValue userData = in_ctxt.GetUserData();
if (userData.IsEmpty())
{
return CStatus::OK;
}
CData *pData = (CData*)(CValue::siPtrType)in_ctxt.GetUserData();
if (pData)
delete pData;
in_ctxt.PutUserData(CValue());
return CStatus::OK;
}
bool checkEleInArray(CDataArray2DLong::Accessor &inArray, ULONG val)
{
for (ULONG i = 0; i < inArray.GetCount(); i++)
{
if (inArray[i] == val)
return true;
}
return false;
}
CStatus getNextIndex(CDataArray2DLong &pointNeighbors, CLongArray &rootIndex, CLongArray &preRoots, CLongArray &result)
{
Application app;
//app.LogMessage("preRoots: " + CString(preRoots));
//app.LogMessage("rootIn: " + CString(rootIndex));
bool done = true;
while (done)
{
done = false;
CLongArray foundPoints;
for (LONG i = 0; i < rootIndex.GetCount(); i++)
{
if ((i + 1) > rootIndex.GetCount()) return CStatus::OK;
LONG startIndex = rootIndex[i - 1 < 0 ? 0 : i - 1];
CDataArray2DLong::Accessor curIndex = pointNeighbors[rootIndex[i]];
LONG nextIndex = rootIndex[i + 1];
//app.LogMessage("startIndex: " + CString(startIndex));
//app.LogMessage("nextIndex: " + CString(nextIndex));
LONG foundPoint = -1;
for (ULONG c = 0; c < curIndex.GetCount(); c++)
{
//app.LogMessage("current inter: " + CString(LONG(i)));
if (i - 1 < 0) {
//check point neighbors count
if (curIndex.GetCount() > 3) {
app.LogMessage("start V false: " + CString(curIndex[c]));
return CStatus::False;
}
//check point neighbors
if (curIndex[c] == preRoots[i] ||
curIndex[c] == nextIndex) continue;
foundPoint = curIndex[c];
preRoots[i] = rootIndex[i];
//app.LogMessage("foundPoint: " + CString(foundPoint));
if (foundPoint == -1) {
done = false;
}
else
{
foundPoints.Add(foundPoint);
done = true;
}
break;
}
if (i + 1 == rootIndex.GetCount()) {
//check point neighbors count
if (curIndex.GetCount() > 3) {
app.LogMessage("end V false: " + CString(curIndex[c]));
return CStatus::False;
}
//check point neighbors
if (curIndex[c] == preRoots[i] ||
curIndex[c] == startIndex) continue;
foundPoint = curIndex[c];
preRoots[i] = rootIndex[i];
//app.LogMessage("foundPoint: " + CString(foundPoint));
if (foundPoint == -1) {
done = false;
}
else
{
foundPoints.Add(foundPoint);
done = true;
}
break;
}
else
{
//check point neighbors count
if (curIndex.GetCount() > 4){
app.LogMessage("V loop false: " + CString(curIndex[c]));
return CStatus::False;
}
//check point neighbors
if (curIndex[c] == preRoots[i] ||
curIndex[c] == startIndex ||
curIndex[c] == nextIndex) continue;
foundPoint = curIndex[c];
preRoots[i] = rootIndex[i];
//app.LogMessage("foundPoint: " + CString(foundPoint));
if (foundPoint == -1) {
done = false;
}
else
{
foundPoints.Add(foundPoint);
done = true;
}
break;
}
}
}
if (done)
{
for (int i = 0; i < foundPoints.GetCount(); i++)
{
rootIndex[i] = foundPoints[i];
result.Add(foundPoints[i]);
}
}
}
//app.LogMessage("rootFound: " + CString(rootIndex));
//app.LogMessage("result: "+CString(result));
//app.LogMessage("done: "+CString(done));
//if (done)
//{
// getNextIndex(pointNeighbors, rootIndex, preRoots, result);
//}
return CStatus::OK;
}
CStatus getPointLoop(ULONG &rootIndex, ULONG &nextPointIndex, ULONG &vIndex, CDataArray2DLong &pointNeighbors, CLongArray &result)
{
Application app;
bool done = true;
{
//get data from per points data
CDataArray2DLong::Accessor curIndex = pointNeighbors[nextPointIndex];
CDataArray2DLong::Accessor aVIndex = pointNeighbors[vIndex];
//for (ULONG i = 0; i < curIndex.GetCount(); i++)
//{
// app.LogMessage("curIndex: "+CString(curIndex[i]));
//}
//app.LogMessage("vIndex: "+CString(vIndex));
if (curIndex.GetCount() < 3)
{
done = false;
}
LONG find = -1;
for (ULONG i = 0; i < curIndex.GetCount(); i++)
{
if (curIndex[i] == rootIndex ||
curIndex[i] == vIndex ) continue;
if (checkEleInArray(aVIndex, curIndex[i]))
{
vIndex = curIndex[i];
continue;
}
find = curIndex[i];
}
if (find == -1) {
done = false;
return CStatus::False;
}
else
{
rootIndex = nextPointIndex;
nextPointIndex = find;
result.Add(nextPointIndex);
done = true;
}
}
//app.LogMessage("root: "+CString(rootIndex));
//app.LogMessage("next: "+CString(nextPointIndex));
//app.LogMessage(CString(done));
if (done)
{
getPointLoop(rootIndex, nextPointIndex, vIndex, pointNeighbors, result);
}
return CStatus::OK;
}
CStatus checkPointNeighbors(CLongArray &rootIndex, CDataArray2DLong &pointNeighbors)
{
Application app;
for (LONG i = 0; i < rootIndex.GetCount(); i++)
{
if ((i + 1) > rootIndex.GetCount()) return CStatus::OK;
LONG startIndex = rootIndex[i - 1 < 0 ? 0 : i - 1];
CDataArray2DLong::Accessor curIndex = pointNeighbors[rootIndex[i]];
LONG nextIndex = rootIndex[i + 1];
//app.LogMessage("startIndex: " + CString(startIndex));
//for(int o = 0; o < curIndex.GetCount(); o++) app.LogMessage("pointNeighbors: " + CString(curIndex[o]));
//app.LogMessage("nextIndex: "+ CString(nextIndex));
if (i - 1 < 0 && curIndex.GetCount() == 2){
if (!checkEleInArray(curIndex, nextIndex)){
app.LogMessage("first root false!");
return CStatus::False;
}
continue;
}
if(i + 1 == rootIndex.GetCount() && curIndex.GetCount() == 2){
if (!checkEleInArray(curIndex, startIndex)){
app.LogMessage("last root false!");
return CStatus::False;
}
continue;
}
if (curIndex.GetCount() == 2) {
if (!checkEleInArray(curIndex, nextIndex)) continue;
if (!checkEleInArray(curIndex, startIndex)) continue;
return CStatus::False;
continue;
}
if (!checkEleInArray(curIndex, nextIndex) ||
!checkEleInArray(curIndex, startIndex)){
app.LogMessage("curIndex: " + CString(rootIndex[i]));
app.LogMessage("in loop root false!");
return CStatus::False;
}
}
return CStatus::OK;
}
I think my current code not work good actually, i'm try to find another way.