| 710 | } |
| 711 | |
| 712 | std::vector<TableMultiVariableLookupPoint> TableMultiVariableLookup_Impl::points() const { |
| 713 | std::vector<TableMultiVariableLookupPoint> result; |
| 714 | |
| 715 | int t_numberofIndependentVariables = numberofIndependentVariables(); |
| 716 | |
| 717 | std::vector<IdfExtensibleGroup> groups = extensibleGroups(); |
| 718 | int numberOfPoints = groups.size() / (t_numberofIndependentVariables + 1); |
| 719 | |
| 720 | for (int iPoint = 0; iPoint != numberOfPoints; ++iPoint) { |
| 721 | std::vector<double> xValues(t_numberofIndependentVariables); |
| 722 | for (int i = 0; i != t_numberofIndependentVariables; ++i) { |
| 723 | IdfExtensibleGroup g = groups[iPoint * (t_numberofIndependentVariables + 1) + i]; |
| 724 | boost::optional<double> d = g.getDouble(OS_Table_MultiVariableLookupExtensibleFields::Data); |
| 725 | OS_ASSERT(d); |
| 726 | xValues[i] = d.get(); |
| 727 | } |
| 728 | |
| 729 | IdfExtensibleGroup g = groups[iPoint * (t_numberofIndependentVariables + 1) + t_numberofIndependentVariables]; |
| 730 | boost::optional<double> d = g.getDouble(OS_Table_MultiVariableLookupExtensibleFields::Data); |
| 731 | OS_ASSERT(d); |
| 732 | double yValue = d.get(); |
| 733 | |
| 734 | TableMultiVariableLookupPoint point(xValues, yValue); |
| 735 | result.push_back(point); |
| 736 | } |
| 737 | |
| 738 | return result; |
| 739 | } |
| 740 | |
| 741 | // Helper function for printTable |
| 742 | std::string centered(const std::string& original, int targetSize) { |