You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
AppFlow/FITK_Interface/FITKInterfaceModel/FITKNodeList.h

162 lines
4.6 KiB
C

/**
*
* @file FITKNodeList.h
* @brief
* @author LiBaojun (libaojunqd@foxmail.com)
* @date 2024-02-28
*
*/
#ifndef __FITKNODELIST_H__
#define __FITKNODELIST_H__
#include "FITKInterfaceModelAPI.h"
#include "FITK_Kernel/FITKCore/FITKAbstractObject.hpp"
#include <QList>
#include <QMap>
#include <QMutex>
namespace Core
{
class FITKNode;
}
namespace Interface
{
/**
* @brief
* @author LiBaojun (libaojunqd@foxmail.com)
* @date 2024-02-28
*/
class FITKInerfaceModelAPI FITKNodeList //: public Core::FITKAbstractObject
{
public:
/**
* @brief Construct a new FITKNodeList object
* @author LiBaojun (libaojunqd@foxmail.com)
* @date 2024-02-28
*/
explicit FITKNodeList() = default;
/**
* @brief Destroy the FITKNodeList object
* @author LiBaojun (libaojunqd@foxmail.com)
* @date 2024-02-28
*/
virtual ~FITKNodeList();
/**
* @brief
* @param[i] x x
* @param[i] y y
* @param[i] z z
* @return int ID
* @author LiBaojun (libaojunqd@foxmail.com)
* @date 2024-02-28
*/
virtual int addNode(const double x, const double y, const double z);
/**
* @brief
* @param[i] id ID
* @param[i] x x
* @param[i] y y
* @param[i] z z
* @author LiBaojun (libaojunqd@foxmail.com)
* @date 2024-02-28
*/
virtual void addNode(const int id, const double x, const double y, const double z);
/**
* @brief indexindex0
* @param[i] index
* @author LiBaojun (libaojunqd@foxmail.com)
* @date 2024-02-28
*/
void removeNodeAt(const int index);
/**
* @brief ID
* @param[i] id ID
* @author LiBaojun (libaojunqd@foxmail.com)
* @date 2024-02-28
*/
void removeNodeByID(const int id);
/**
* @brief
* @return int
* @author LiBaojun (libaojunqd@foxmail.com)
* @date 2024-02-28
*/
int getNodeCount();
/**
* @brief index
* @param[i] index
* @return Core::FITKNode*
* @author LiBaojun (libaojunqd@foxmail.com)
* @date 2024-02-28
*/
Core::FITKNode* getNodeAt(const int index);
/**
* @brief ID
* @param[i] id ID
* @return Core::FITKNode*
* @author LiBaojun (libaojunqd@foxmail.com)
* @date 2024-02-28
*/
Core::FITKNode* getNodeByID(const int id);
/**
* @brief ID
* @param[i] index
* @return int
* @author LiBaojun (libaojunqd@foxmail.com)
* @date 2024-02-28
*/
int getNodeIDByIndex(const int index);
/**
* @brief ID
* @param[i] id ID
* @return int
* @author LiBaojun (libaojunqd@foxmail.com)
* @date 2024-02-28
*/
int getNodeIndexByID(const int id);
/**
* @brief id
* @return int
* @author LiBaojun (libaojunqd@foxmail.com)
* @date 2024-03-28
*/
int getNodeMaxID();
/**
* @brief
* @author LiBaojun (libaojunqd@foxmail.com)
* @date 2024-03-28
*/
void removeAllNode();
private:
/**
* @brief 线
* @author LiBaojun (libaojunqd@foxmail.com)
* @date 2024-02-28
*/
QMutex _mutex;
/**
* @brief
* @author LiBaojun (libaojunqd@foxmail.com)
* @date 2024-02-28
*/
QList<Core::FITKNode*> _nodeList{};
/**
* @brief IDindex
* @author LiBaojun (libaojunqd@foxmail.com)
* @date 2024-02-28
*/
QMap<int, int> _idIndexMap{};
/**
* @brief ID
* @author LiBaojun (libaojunqd@foxmail.com)
* @date 2024-03-22
*/
int _nodeMaxID = 0;
};
}
#endif // !__FITKNODELIST_H__