24#include <api/board/board_types.pb.h>
25#include <google/protobuf/any.pb.h>
83 return *
this ==
static_cast<const PCB_3D_BODY&
>( aOther );
99 aOutput.mutable_id()->set_value(
m_Uuid.AsStdString() );
102 aOutput.mutable_parent()->set_value( parent->m_Uuid.AsStdString() );
104 aOutput.mutable_parent()->set_value(
board->m_Uuid.AsStdString() );
106 aOutput.set_kind( types::Body3DKind::BDK_EXTRUDED );
113 types::ExtrudedBody* extruded = aOutput.mutable_extruded();
133 kiapi::board::types::Body3D msg;
135 aContainer.PackFrom( msg );
143 if( aInput.kind() != types::BDK_EXTRUDED || !aInput.has_extruded() )
153 const types::ExtrudedBody& extruded = aInput.extruded();
158 switch( extruded.material() )
168 if( extruded.has_color() )
179 kiapi::board::types::Body3D msg;
181 if( !aContainer.UnpackTo( &msg ) )
KICOMMON_API types::KiCadObjectType ToProtoEnum(KICAD_T aValue)
KICOMMON_API KICAD_T FromProtoEnum(types::KiCadObjectType aValue)
A base class for any item which can be embedded within the BOARD container class, and therefore insta...
BOARD_ITEM(BOARD_ITEM *aParent, KICAD_T idtype, PCB_LAYER_ID aLayer=F_Cu)
void SetUuidDirect(const KIID &aUuid)
Raw UUID assignment.
virtual const BOARD * GetBoard() const
Return the BOARD in which this BOARD_ITEM resides, or NULL if none.
FOOTPRINT * GetParentFootprint() const
Information pertinent to a Pcbnew printed circuit board.
KICAD_T Type() const
Returns the type of object.
static const COLOR4D UNSPECIFIED
For legacy support; used as a value to indicate color hasn't been set yet.
A 3D body attached to a footprint (or, later, placed on a board).
void Flip(const VECTOR2I &aCentre, FLIP_DIRECTION aFlipDirection) override
Flip this object, i.e.
bool operator==(const PCB_3D_BODY &aOther) const
PCB_3D_BODY(BOARD_ITEM *aParent=nullptr)
double Similarity(const BOARD_ITEM &aOther) const override
Return a measure of how likely the other object is to represent the same object.
void Serialize(google::protobuf::Any &aContainer) const override
Serializes this object to the given Any message.
void CopyFrom(const BOARD_ITEM *aOther) override
EXTRUDED_3D_BODY m_extruded
bool Deserialize(const google::protobuf::Any &aContainer) override
Deserializes the given protobuf message into this object.
void swapData(BOARD_ITEM *aImage) override
void InheritsAfter(TYPE_ID aDerived, TYPE_ID aBase)
Declare an inheritance relationship between types.
static PROPERTY_MANAGER & Instance()
Some functions to handle hotkeys in KiCad.
PCB_LAYER_ID FlipLayer(PCB_LAYER_ID aLayerId, int aCopperLayersCount)
KICOMMON_API void PackColor(types::Color &aOutput, const KIGFX::COLOR4D &aInput)
KICOMMON_API int UnpackDistance(const types::Distance &aInput, const EDA_IU_SCALE &aScale)
KICOMMON_API VECTOR3D UnpackVector3D(const types::Vector3D &aInput)
KICOMMON_API KIGFX::COLOR4D UnpackColor(const types::Color &aInput)
KICOMMON_API void PackDistance(types::Distance &aOutput, int aInput, const EDA_IU_SCALE &aScale)
KICOMMON_API void PackVector3D(types::Vector3D &aOutput, const VECTOR3D &aInput)
static struct PCB_3D_BODY_DESC _PCB_3D_BODY_DESC
#define TYPE_HASH(x)
Macro to generate unique identifier for a type.
#define REGISTER_TYPE(x)
Helper macro to map type hashes to names.
@ PCB_3D_BODY_T
class PCB_3D_BODY, a 3D body (extruded or model) on a footprint
VECTOR2< int32_t > VECTOR2I