LAMPCAE/src/Geometry/GeoComponent.h

143 lines
3.6 KiB
C
Raw Normal View History

2023-05-08 06:32:41 +00:00
/**
* @file GeoComponent.h
* @brief
* @author FastCAE(fastcae@diso.cn)
* @version 2.5.0
* @date 2022-03-28 13:41
* @copyright Copyright (c) Since 2020 All rights reserved.
*
* ============================================================================
* Program: FastCAE
*
* Copyright (c) Since 2020 All rights reserved.
* See License or http://www.fastcae.com/ for details.
*
* BSD 3-Clause License
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED.
* ==================================================================================
*/
#ifndef _GEOCOMPONENT_H_
#define _GEOCOMPONENT_H_
#include "geometryAPI.h"
#include "DataProperty/ComponentBase.h"
#include <qhash.h>
class vtkPolyData;
namespace Geometry
{
/**
* @brief
* @since 2.5.0
*/
enum GeoComponentType
{
Node, ///< 点
Line, ///< 线
Surface, ///< 面
Body ///< 体
};
class GeometrySet;
/**
* @brief
* @since 2.5.0
*/
class GEOMETRYAPI GeoComponent : public DataProperty::ComponentBase
{
public:
/**
* @brief
* @param name
* @param type
* @since 2.5.0
*/
GeoComponent(QString name, GeoComponentType type);
/**
* @brief
* @since 2.5.0
*/
~GeoComponent();
/**
* @brief
* @param type
* @since 2.5.0
*/
void setType(GeoComponentType type);
/**
* @brief
* @return GeoComponentType
* @since 2.5.0
*/
GeoComponentType getGCType();
/**
* @brief
* @param items
* @since 2.5.0
*/
void appendSelectedItem(QMultiHash<GeometrySet *, int> &items);
/**
* @brief
* @param geoSet
* @param itemIndex id
* @since 2.5.0
*/
void appendSelectedItem(GeometrySet *geoSet, int itemIndex);
/**
* @brief
* @param geoSet
* @param itemIndexs id
* @since 2.5.0
*/
void appendSelectedItem(GeometrySet *geoSet, QList<int> &itemIndexs);
/**
* @brief
* @param items
* @since 2.5.0
*/
void setSelectedItems(QMultiHash<GeometrySet *, int> &items);
/**
* @brief
* @return QMultiHash<GeometrySet *, int>&
* @since 2.5.0
*/
QMultiHash<GeometrySet *, int> &getSelectedItems();
/**
* @brief
* @param stype
* @return GeoComponentType
* @since 2.5.0
*/
static GeoComponentType stringTogcType(QString stype);
/**
* @brief
* @param type
* @return QString
* @since 2.5.0
*/
static QString gcTypeToString(GeoComponentType type);
virtual QDomElement &writeToProjectFile(QDomDocument *doc, QDomElement *root) override;
virtual void readDataFromProjectFile(QDomElement *root) override;
private:
/**
* @brief
* @since 2.5.0
*/
GeoComponentType _type;
/**
* @brief
* @since 2.5.0
*/
QMultiHash<GeometrySet *, int> _selectedItems{};
};
}
#endif