36 #define P2ATOM_SIZE 96
37 #define P2ATOM_RADIUS 5
39 #define P2ATOM_HEADER_SIZE 8
40 #define P2ATOM_LONGBOND_SIZE 8
41 #define P2ATOM_SHORTBOND_SIZE 4
48 public:
enum { ATOM_CATEGORY = 2 };
56 static u32 StateFunc(
P2Atom* atom)
58 return atom->GetState();
77 bool HasBeenRepaired()
85 {
return m_bits.
Read(2, 6); }
87 void SetState(u32 state)
88 { m_bits.
Write(2, 6, state); }
90 u32 GetLongBondCount()
91 {
return m_bits.
Read(9, 3); }
93 void SetLongBondCount(u32 count)
94 { m_bits.
Write(9, 3, count); }
96 u32 GetShortBondCount()
97 {
return m_bits.
Read(12, 4); }
99 void SetShortBondCount(u32 count)
100 { m_bits.
Write(12, 4, count); }
102 void ReadVariableBodyInto(u32* arr)
104 arr[0] = m_bits.
Read(16, 16);
105 arr[1] = m_bits.
Read(32, 32);
108 void WriteVariableBodyFrom(u32* arr)
110 m_bits.
Write(16, 16, arr[0]);
111 m_bits.
Write(32, 32, arr[1]);
114 void WriteLowerBits(u32 val)
116 m_bits.
Write(32, 32, val);
121 return m_bits.
Read(32, 32);
125 { m_bits.
Print(ostream); }
128 u32 AddLongBond(
const SPoint& offset);
130 u32 AddShortBond(
const SPoint& offset);
133 void FillLongBond(u32 index,
SPoint& pt);
135 void FillShortBond(u32 index,
SPoint& pt);
144 void RemoveLongBond(u32 index);
146 void RemoveShortBond(u32 index);
void Write(const u32 startIdx, const u32 length, const u32 value)
Definition: BitVector.tcc:99
u32 Read(const u32 startIdx, const u32 length) const
Definition: BitVector.tcc:129
void Print(ByteSink &ostream) const
Definition: BitVector.tcc:202
Definition: ByteSink.h:47