Simple Nano Circuit 0.0.2
BaseIcObject.h
1#ifndef _BaseIcObjec_H_
2#define _BaseIcObjec_H_
3
4#include <vector>
5#include "FootPinNode.h"
6#include "BaseElectronObject.h"
7
9
11{
12 private:
13 enum class ColorStyle
14 {
15 Solid = 1,
16 Translucent
17 };
18
19 SDL_Rect selfLocationRect;
20 void drawingRedCrossSymbol();
21
22 protected:
23 int rotateNumber = 0;
24 int mirrowNumber = 0;
25 void symbolChangeRotate();
26 void symbolChangeMirrow();
27
28 public:
29 SDL_Point centerPos;
30 SDL_Texture* selfTexture = nullptr;
31
32 int symbolWidth = 0;
33 int symbolHeight = 0;
34
35 bool symbolCouldRotate = true;
36 bool symbolCouldMirrow = false;
37
38 uint32_t* symbol_pixel_data = nullptr;
39
40 // IC上分布的各个引脚
41 std::vector<FootPinNode*> footPinNodes;
42
46
47 void setupPixelData( const uint32_t* );
48
49 void createSelfTexture( BaseIcObject::ColorStyle );
50
51 void processKeyEvent( int ) override;
52
53 void Drawing() override;
54 void Drawing( BaseElectronObject::RendererEffective ) override;
55
56 BaseElectronObject* processClickEvent( SDL_Point& ) override;
57
58 SDL_Rect getLocationRect() override;
59
60 virtual void pinInvalidNotify(FootPinNode*);
61 virtual void setCurrentNotify(FootPinNode*);
62
63 virtual FootPinNode* getOppositePin(const FootPinNode*);
64 virtual NetlistClass* getOppositeNetlist(const FootPinNode*);
65
66 virtual double getVoltageFrom(const NetlistClass*);
67 virtual double getVoltageFrom(const FootPinNode*);
68
69 void processMouseMotion(const SDL_Point&) override;
70
71 void updateLocationAndRotateMirrow(SDL_Point, int, int);
72
73 protected:
74 virtual void init() = 0;
75 virtual void setupFootPins() = 0;
76};
77
78#endif
Definition: AsgardClass.h:17
Definition: BaseElectronObject.h:13
Definition: BaseIcObject.h:11
Definition: FootPinNode.h:15
Definition: NetlistClass.h:19
Definition: PlacementManagerClass.h:18