@@ -1188,7 +1188,7 @@ IndigoObject* IndigoSGroupAtomsIter::next()
11881188 return new IndigoAtom (_mol, _sgroup.atoms [_idx]);
11891189}
11901190
1191- IndigoSGroupBondsIter::IndigoSGroupBondsIter (BaseMolecule& mol, SGroup& sgroup) : IndigoObject(SGROUP_ATOMS_ITER ), _mol(mol), _sgroup(sgroup)
1191+ IndigoSGroupBondsIter::IndigoSGroupBondsIter (BaseMolecule& mol, SGroup& sgroup) : IndigoObject(SGROUP_BONDS_ITER ), _mol(mol), _sgroup(sgroup)
11921192{
11931193 _idx = -1 ;
11941194}
@@ -1199,7 +1199,7 @@ IndigoSGroupBondsIter::~IndigoSGroupBondsIter()
11991199
12001200bool IndigoSGroupBondsIter::hasNext ()
12011201{
1202- return _idx + 1 < _sgroup.bonds .size ();
1202+ return _idx + 1 < _sgroup.getBonds () .size ();
12031203}
12041204
12051205IndigoObject* IndigoSGroupBondsIter::next ()
@@ -1208,7 +1208,30 @@ IndigoObject* IndigoSGroupBondsIter::next()
12081208 return 0 ;
12091209
12101210 _idx++;
1211- return new IndigoBond (_mol, _sgroup.bonds [_idx]);
1211+ return new IndigoBond (_mol, _sgroup.getBonds ()[_idx]);
1212+ }
1213+
1214+ IndigoSGroupXBondsIter::IndigoSGroupXBondsIter (BaseMolecule& mol, SGroup& sgroup) : IndigoObject(SGROUP_BONDS_ITER ), _mol(mol), _sgroup(sgroup)
1215+ {
1216+ _idx = -1 ;
1217+ }
1218+
1219+ IndigoSGroupXBondsIter::~IndigoSGroupXBondsIter ()
1220+ {
1221+ }
1222+
1223+ bool IndigoSGroupXBondsIter::hasNext ()
1224+ {
1225+ return _idx + 1 < _sgroup.xbonds .size ();
1226+ }
1227+
1228+ IndigoObject* IndigoSGroupXBondsIter::next ()
1229+ {
1230+ if (!hasNext ())
1231+ return 0 ;
1232+
1233+ _idx++;
1234+ return new IndigoBond (_mol, _sgroup.xbonds [_idx]);
12121235}
12131236
12141237int _indigoIterateAtoms (Indigo& self, int molecule, int type)
@@ -1352,7 +1375,7 @@ CEXPORT int indigoCountBonds(int molecule)
13521375
13531376 auto sg = _getSGroupFromObject (obj);
13541377 if (sg)
1355- return sg.get ().bonds .size ();
1378+ return sg.get ().getBonds () .size ();
13561379
13571380 BaseMolecule& mol = obj.getBaseMolecule ();
13581381
0 commit comments