Explorar el Código

Release CalcBMD.

sdk-team hace 3 años
padre
commit
917b2cbb5c

+ 1 - 1
VERSION

@@ -1 +1 @@
-1.36.1521
+1.36.1522

+ 4 - 0
imageprocess/CMakeLists.txt

@@ -23,6 +23,8 @@ set(imageprocess_public_header
 set(imageprocess_public_header_model 
 	include/alibabacloud/imageprocess/model/AnalyzeChestVesselRequest.h
 	include/alibabacloud/imageprocess/model/AnalyzeChestVesselResult.h
+	include/alibabacloud/imageprocess/model/CalcBMDRequest.h
+	include/alibabacloud/imageprocess/model/CalcBMDResult.h
 	include/alibabacloud/imageprocess/model/CalcCACSRequest.h
 	include/alibabacloud/imageprocess/model/CalcCACSResult.h
 	include/alibabacloud/imageprocess/model/ClassifyFNFRequest.h
@@ -72,6 +74,8 @@ set(imageprocess_src
 	src/ImageprocessClient.cc
 	src/model/AnalyzeChestVesselRequest.cc
 	src/model/AnalyzeChestVesselResult.cc
+	src/model/CalcBMDRequest.cc
+	src/model/CalcBMDResult.cc
 	src/model/CalcCACSRequest.cc
 	src/model/CalcCACSResult.cc
 	src/model/ClassifyFNFRequest.cc

+ 8 - 0
imageprocess/include/alibabacloud/imageprocess/ImageprocessClient.h

@@ -24,6 +24,8 @@
 #include "ImageprocessExport.h"
 #include "model/AnalyzeChestVesselRequest.h"
 #include "model/AnalyzeChestVesselResult.h"
+#include "model/CalcBMDRequest.h"
+#include "model/CalcBMDResult.h"
 #include "model/CalcCACSRequest.h"
 #include "model/CalcCACSResult.h"
 #include "model/ClassifyFNFRequest.h"
@@ -80,6 +82,9 @@ namespace AlibabaCloud
 			typedef Outcome<Error, Model::AnalyzeChestVesselResult> AnalyzeChestVesselOutcome;
 			typedef std::future<AnalyzeChestVesselOutcome> AnalyzeChestVesselOutcomeCallable;
 			typedef std::function<void(const ImageprocessClient*, const Model::AnalyzeChestVesselRequest&, const AnalyzeChestVesselOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> AnalyzeChestVesselAsyncHandler;
+			typedef Outcome<Error, Model::CalcBMDResult> CalcBMDOutcome;
+			typedef std::future<CalcBMDOutcome> CalcBMDOutcomeCallable;
+			typedef std::function<void(const ImageprocessClient*, const Model::CalcBMDRequest&, const CalcBMDOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> CalcBMDAsyncHandler;
 			typedef Outcome<Error, Model::CalcCACSResult> CalcCACSOutcome;
 			typedef std::future<CalcCACSOutcome> CalcCACSOutcomeCallable;
 			typedef std::function<void(const ImageprocessClient*, const Model::CalcCACSRequest&, const CalcCACSOutcome&, const std::shared_ptr<const AsyncCallerContext>&)> CalcCACSAsyncHandler;
@@ -154,6 +159,9 @@ namespace AlibabaCloud
 			AnalyzeChestVesselOutcome analyzeChestVessel(const Model::AnalyzeChestVesselRequest &request)const;
 			void analyzeChestVesselAsync(const Model::AnalyzeChestVesselRequest& request, const AnalyzeChestVesselAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
 			AnalyzeChestVesselOutcomeCallable analyzeChestVesselCallable(const Model::AnalyzeChestVesselRequest& request) const;
+			CalcBMDOutcome calcBMD(const Model::CalcBMDRequest &request)const;
+			void calcBMDAsync(const Model::CalcBMDRequest& request, const CalcBMDAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
+			CalcBMDOutcomeCallable calcBMDCallable(const Model::CalcBMDRequest& request) const;
 			CalcCACSOutcome calcCACS(const Model::CalcCACSRequest &request)const;
 			void calcCACSAsync(const Model::CalcCACSRequest& request, const CalcCACSAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context = nullptr) const;
 			CalcCACSOutcomeCallable calcCACSCallable(const Model::CalcCACSRequest& request) const;

+ 60 - 0
imageprocess/include/alibabacloud/imageprocess/model/CalcBMDRequest.h

@@ -0,0 +1,60 @@
+/*
+ * Copyright 2009-2017 Alibaba Cloud All rights reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef ALIBABACLOUD_IMAGEPROCESS_MODEL_CALCBMDREQUEST_H_
+#define ALIBABACLOUD_IMAGEPROCESS_MODEL_CALCBMDREQUEST_H_
+
+#include <alibabacloud/imageprocess/ImageprocessExport.h>
+#include <alibabacloud/core/RpcServiceRequest.h>
+#include <string>
+#include <vector>
+#include <map>
+
+namespace AlibabaCloud {
+namespace Imageprocess {
+namespace Model {
+class ALIBABACLOUD_IMAGEPROCESS_EXPORT CalcBMDRequest : public RpcServiceRequest {
+public:
+	struct URLList {
+		std::string uRL;
+	};
+	CalcBMDRequest();
+	~CalcBMDRequest();
+	std::string getOrgName() const;
+	void setOrgName(const std::string &orgName);
+	std::string getSourceType() const;
+	void setSourceType(const std::string &sourceType);
+	std::string getDataFormat() const;
+	void setDataFormat(const std::string &dataFormat);
+	std::vector<URLList> getURLList() const;
+	void setURLList(const std::vector<URLList> &uRLList);
+	std::string getOrgId() const;
+	void setOrgId(const std::string &orgId);
+	bool getAsync() const;
+	void setAsync(bool async);
+
+private:
+	std::string orgName_;
+	std::string sourceType_;
+	std::string dataFormat_;
+	std::vector<URLList> uRLList_;
+	std::string orgId_;
+	bool async_;
+};
+} // namespace Model
+} // namespace Imageprocess
+} // namespace AlibabaCloud
+#endif // !ALIBABACLOUD_IMAGEPROCESS_MODEL_CALCBMDREQUEST_H_

+ 70 - 0
imageprocess/include/alibabacloud/imageprocess/model/CalcBMDResult.h

@@ -0,0 +1,70 @@
+/*
+ * Copyright 2009-2017 Alibaba Cloud All rights reserved.
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#ifndef ALIBABACLOUD_IMAGEPROCESS_MODEL_CALCBMDRESULT_H_
+#define ALIBABACLOUD_IMAGEPROCESS_MODEL_CALCBMDRESULT_H_
+
+#include <string>
+#include <vector>
+#include <utility>
+#include <alibabacloud/core/ServiceResult.h>
+#include <alibabacloud/imageprocess/ImageprocessExport.h>
+
+namespace AlibabaCloud
+{
+	namespace Imageprocess
+	{
+		namespace Model
+		{
+			class ALIBABACLOUD_IMAGEPROCESS_EXPORT CalcBMDResult : public ServiceResult
+			{
+			public:
+				struct Data
+				{
+					struct DetectionsItem
+					{
+						float vertZScore;
+						float vertTScore;
+						float vertCategory;
+						float vertBMD;
+						std::string vertId;
+					};
+					std::vector<std::string> origin;
+					std::vector<std::string> spacing;
+					std::vector<DetectionsItem> detections;
+					std::string resultURL;
+				};
+
+
+				CalcBMDResult();
+				explicit CalcBMDResult(const std::string &payload);
+				~CalcBMDResult();
+				std::string getMessage()const;
+				Data getData()const;
+				std::string getCode()const;
+
+			protected:
+				void parse(const std::string &payload);
+			private:
+				std::string message_;
+				Data data_;
+				std::string code_;
+
+			};
+		}
+	}
+}
+#endif // !ALIBABACLOUD_IMAGEPROCESS_MODEL_CALCBMDRESULT_H_

+ 36 - 0
imageprocess/src/ImageprocessClient.cc

@@ -87,6 +87,42 @@ ImageprocessClient::AnalyzeChestVesselOutcomeCallable ImageprocessClient::analyz
 	return task->get_future();
 }
 
+ImageprocessClient::CalcBMDOutcome ImageprocessClient::calcBMD(const CalcBMDRequest &request) const
+{
+	auto endpointOutcome = endpointProvider_->getEndpoint();
+	if (!endpointOutcome.isSuccess())
+		return CalcBMDOutcome(endpointOutcome.error());
+
+	auto outcome = makeRequest(endpointOutcome.result(), request);
+
+	if (outcome.isSuccess())
+		return CalcBMDOutcome(CalcBMDResult(outcome.result()));
+	else
+		return CalcBMDOutcome(outcome.error());
+}
+
+void ImageprocessClient::calcBMDAsync(const CalcBMDRequest& request, const CalcBMDAsyncHandler& handler, const std::shared_ptr<const AsyncCallerContext>& context) const
+{
+	auto fn = [this, request, handler, context]()
+	{
+		handler(this, request, calcBMD(request), context);
+	};
+
+	asyncExecute(new Runnable(fn));
+}
+
+ImageprocessClient::CalcBMDOutcomeCallable ImageprocessClient::calcBMDCallable(const CalcBMDRequest &request) const
+{
+	auto task = std::make_shared<std::packaged_task<CalcBMDOutcome()>>(
+			[this, request]()
+			{
+			return this->calcBMD(request);
+			});
+
+	asyncExecute(new Runnable([task]() { (*task)(); }));
+	return task->get_future();
+}
+
 ImageprocessClient::CalcCACSOutcome ImageprocessClient::calcCACS(const CalcCACSRequest &request) const
 {
 	auto endpointOutcome = endpointProvider_->getEndpoint();

+ 85 - 0
imageprocess/src/model/CalcBMDRequest.cc

@@ -0,0 +1,85 @@
+/*
+ * Copyright 2009-2017 Alibaba Cloud All rights reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include <alibabacloud/imageprocess/model/CalcBMDRequest.h>
+
+using AlibabaCloud::Imageprocess::Model::CalcBMDRequest;
+
+CalcBMDRequest::CalcBMDRequest()
+    : RpcServiceRequest("imageprocess", "2020-03-20", "CalcBMD") {
+  setMethod(HttpRequest::Method::Post);
+}
+
+CalcBMDRequest::~CalcBMDRequest() {}
+
+std::string CalcBMDRequest::getOrgName() const {
+  return orgName_;
+}
+
+void CalcBMDRequest::setOrgName(const std::string &orgName) {
+  orgName_ = orgName;
+  setBodyParameter(std::string("OrgName"), orgName);
+}
+
+std::string CalcBMDRequest::getSourceType() const {
+  return sourceType_;
+}
+
+void CalcBMDRequest::setSourceType(const std::string &sourceType) {
+  sourceType_ = sourceType;
+  setBodyParameter(std::string("SourceType"), sourceType);
+}
+
+std::string CalcBMDRequest::getDataFormat() const {
+  return dataFormat_;
+}
+
+void CalcBMDRequest::setDataFormat(const std::string &dataFormat) {
+  dataFormat_ = dataFormat;
+  setBodyParameter(std::string("DataFormat"), dataFormat);
+}
+
+std::vector<CalcBMDRequest::URLList> CalcBMDRequest::getURLList() const {
+  return uRLList_;
+}
+
+void CalcBMDRequest::setURLList(const std::vector<CalcBMDRequest::URLList> &uRLList) {
+  uRLList_ = uRLList;
+  for(int dep1 = 0; dep1 != uRLList.size(); dep1++) {
+  auto uRLListObj = uRLList.at(dep1);
+  std::string uRLListObjStr = std::string("URLList") + "." + std::to_string(dep1 + 1);
+    setBodyParameter(uRLListObjStr + ".URL", uRLListObj.uRL);
+  }
+}
+
+std::string CalcBMDRequest::getOrgId() const {
+  return orgId_;
+}
+
+void CalcBMDRequest::setOrgId(const std::string &orgId) {
+  orgId_ = orgId;
+  setBodyParameter(std::string("OrgId"), orgId);
+}
+
+bool CalcBMDRequest::getAsync() const {
+  return async_;
+}
+
+void CalcBMDRequest::setAsync(bool async) {
+  async_ = async;
+  setBodyParameter(std::string("Async"), async ? "true" : "false");
+}
+

+ 88 - 0
imageprocess/src/model/CalcBMDResult.cc

@@ -0,0 +1,88 @@
+/*
+ * Copyright 2009-2017 Alibaba Cloud All rights reserved.
+ * 
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include <alibabacloud/imageprocess/model/CalcBMDResult.h>
+#include <json/json.h>
+
+using namespace AlibabaCloud::Imageprocess;
+using namespace AlibabaCloud::Imageprocess::Model;
+
+CalcBMDResult::CalcBMDResult() :
+	ServiceResult()
+{}
+
+CalcBMDResult::CalcBMDResult(const std::string &payload) :
+	ServiceResult()
+{
+	parse(payload);
+}
+
+CalcBMDResult::~CalcBMDResult()
+{}
+
+void CalcBMDResult::parse(const std::string &payload)
+{
+	Json::Reader reader;
+	Json::Value value;
+	reader.parse(payload, value);
+	setRequestId(value["RequestId"].asString());
+	auto dataNode = value["Data"];
+	if(!dataNode["ResultURL"].isNull())
+		data_.resultURL = dataNode["ResultURL"].asString();
+	auto allDetectionsNode = dataNode["Detections"]["DetectionsItem"];
+	for (auto dataNodeDetectionsDetectionsItem : allDetectionsNode)
+	{
+		Data::DetectionsItem detectionsItemObject;
+		if(!dataNodeDetectionsDetectionsItem["VertId"].isNull())
+			detectionsItemObject.vertId = dataNodeDetectionsDetectionsItem["VertId"].asString();
+		if(!dataNodeDetectionsDetectionsItem["VertBMD"].isNull())
+			detectionsItemObject.vertBMD = std::stof(dataNodeDetectionsDetectionsItem["VertBMD"].asString());
+		if(!dataNodeDetectionsDetectionsItem["VertTScore"].isNull())
+			detectionsItemObject.vertTScore = std::stof(dataNodeDetectionsDetectionsItem["VertTScore"].asString());
+		if(!dataNodeDetectionsDetectionsItem["VertZScore"].isNull())
+			detectionsItemObject.vertZScore = std::stof(dataNodeDetectionsDetectionsItem["VertZScore"].asString());
+		if(!dataNodeDetectionsDetectionsItem["VertCategory"].isNull())
+			detectionsItemObject.vertCategory = std::stof(dataNodeDetectionsDetectionsItem["VertCategory"].asString());
+		data_.detections.push_back(detectionsItemObject);
+	}
+		auto allSpacing = dataNode["Spacing"]["Spacing"];
+		for (auto value : allSpacing)
+			data_.spacing.push_back(value.asString());
+		auto allOrigin = dataNode["Origin"]["Origin"];
+		for (auto value : allOrigin)
+			data_.origin.push_back(value.asString());
+	if(!value["Code"].isNull())
+		code_ = value["Code"].asString();
+	if(!value["Message"].isNull())
+		message_ = value["Message"].asString();
+
+}
+
+std::string CalcBMDResult::getMessage()const
+{
+	return message_;
+}
+
+CalcBMDResult::Data CalcBMDResult::getData()const
+{
+	return data_;
+}
+
+std::string CalcBMDResult::getCode()const
+{
+	return code_;
+}
+